1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

lib/DtTerm/TermPrim: clean up defines

This commit is contained in:
Chase 2022-08-03 18:41:37 -05:00 committed by Jon Trulson
parent b38c2b02a8
commit 06863e826e
4 changed files with 14 additions and 36 deletions

View file

@ -35,24 +35,6 @@ libTermPrim_la_SOURCES = TermPrim.c \
if SOLARIS
libTermPrim_la_SOURCES += TermPrimGetPty-svr4.c
AM_CPPFLAGS += -DSUN_ARCHITECTURE
endif
# Use the posix pts api, like linux
if BSD
else
libTermPrim_la_SOURCES += TermPrimGetPty-pts.c
# uses CSRG_BASED global define
endif
if FREEBSD
AM_CPPFLAGS += -DFREEBSD_ARCHITECTURE
endif
if OPENBSD
AM_CPPFLAGS += -DOPENBSD_ARCHITECTURE
endif
if LINUX
libTermPrim_la_SOURCES += TermPrimGetPty-pts.c
AM_CPPFLAGS += -DLINUX_ARCHITECTURE
endif

View file

@ -63,12 +63,12 @@
#ifndef _Dt_TermPrimOSDepI_h
#define _Dt_TermPrimOSDepI_h
#ifdef LINUX_ARCHITECTURE
#ifdef __linux__
# define USE_TIOCCONS /* use tioccons for -C */
# define HAS_SETEUID /* seteuid available */
# define HAS_SETREUID /* setreuid available */
# define USE_TCSENDBREAK /* use tiocbreak() */
#endif /* LINUX_ARCHITECTURE */
#endif /* LINUX */
#ifdef CSRG_BASED
# define HAS_SETEUID /* seteuid available */
@ -76,7 +76,7 @@
# define USE_TCSENDBREAK /* use tiocbreak() */
#endif /* CSRG_BASED */
#ifdef SUN_ARCHITECTURE
#ifdef sun
# define XOR_CAPS_LOCK /* xor caps lock and shift */
# define USE_SRIOCSREDIR /* use SRIOCSREDIR ioctl for -C */
# define USE_STREAMS /* use streams */
@ -87,7 +87,7 @@
# define USE_SUN_WCWIDTH_PATCH
# define wcwidth(w) sun_wcwidth(w)
# endif /* (_XOPEN_VERSION == 3) */
#endif /* SUN_ARCHITECTURE */
#endif /* SUN */
#ifdef IBM_ARCHITECTURE
/* this seems to be #define'ed in the world of imake... */

View file

@ -55,9 +55,9 @@
#include <sys/stat.h>
#endif /* USE_TIOCCONS */
#if defined(LINUX_ARCHITECTURE) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#include <sys/ioctl.h>
#endif /* LINUX_ARCHITECTURE */
#endif /* LINUX */
#ifdef USE_STREAMS
#include <sys/types.h>
@ -569,7 +569,7 @@ _DtTermPrimPtyInit
TMODE (XTTYMODE_weras, tio.c_cc[VWERSE]);
TMODE (XTTYMODE_lnext, tio.c_cc[VLNEXT]);
#elif defined(SUN_ARCHITECTURE)
#elif defined(sun)
TMODE (XTTYMODE_swtch, tio.c_cc[VSWTCH]);
TMODE (XTTYMODE_start, tio.c_cc[VSTART]);
TMODE (XTTYMODE_stop, tio.c_cc[VSTOP]);

View file

@ -32,7 +32,7 @@
#include "TermHeader.h"
#include <fcntl.h>
#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
#if defined(CSRG_BASED) || defined(__linux__)
/* For TIOCSTTY definitions */
#include <sys/ioctl.h>
#endif /* BSD || Linux */
@ -47,11 +47,7 @@
#include <X11/Xos_r.h>
#include <Xm/Xm.h>
#if defined(HPVUE)
#include <Xv/EnvControl.h>
#else /* HPVUE */
#include <Dt/EnvControlP.h>
#endif /* HPVUE */
#include "TermPrimP.h"
#include "TermPrimI.h"
@ -451,7 +447,7 @@ _DtTermPrimSubprocExec(Widget w,
/* child...
*/
_DtTermProcessUnlock();
#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
#if defined(CSRG_BASED) || defined(__linux__)
/* establish a new session for child */
setsid();
#else
@ -459,7 +455,7 @@ _DtTermPrimSubprocExec(Widget w,
(void) setpgrp();
#endif /* Linux || BSD */
#if defined(LINUX_ARCHITECTURE)
#if defined(__linux__)
/* set the ownership and mode of the pty... */
(void) _DtTermPrimSetupPty(ptyName, pty);
#endif
@ -472,7 +468,7 @@ _DtTermPrimSubprocExec(Widget w,
(void) _exit(1);
}
#if defined(CSRG_BASED) || defined(LINUX_ARCHITECTURE)
#if defined(CSRG_BASED) || defined(__linux__)
/* BSD needs to do this to acquire pty as controlling terminal */
if (ioctl(pty, TIOCSCTTY, (char *)NULL) < 0) {
(void) close(pty);
@ -485,10 +481,10 @@ _DtTermPrimSubprocExec(Widget w,
_DtTermPrimPtyGetDefaultModes();
#endif /* Linux || BSD */
#if !defined(LINUX_ARCHITECTURE)
#if !defined(__linux__)
/* set the ownership and mode of the pty... */
(void) _DtTermPrimSetupPty(ptyName, pty);
#endif /* LINUX_ARCHITECTURE */
#endif /* LINUX */
/* apply the ttyModes... */
_DtTermPrimPtyInit(pty, tw->term.ttyModes, tw->term.csWidth);