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 if SOLARIS
libTermPrim_la_SOURCES += TermPrimGetPty-svr4.c libTermPrim_la_SOURCES += TermPrimGetPty-svr4.c
AM_CPPFLAGS += -DSUN_ARCHITECTURE else
endif
# Use the posix pts api, like linux
if BSD
libTermPrim_la_SOURCES += TermPrimGetPty-pts.c 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 endif

View file

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

View file

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

View file

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