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

Use POSIX macros for linux

This commit is contained in:
chase 2018-05-24 16:24:41 -05:00 committed by Jon Trulson
parent 164e695cd0
commit 4f5e7fe5e3
265 changed files with 394 additions and 394 deletions

View file

@ -261,7 +261,7 @@ TIRPCINC =
# define StandardCppDefines -traditional
#endif /* Mc68020Architecture */
#define StandardDefines -Dlinux LinuxMachineDefines LinuxSourceDefines
#define StandardDefines -D__linux__ LinuxMachineDefines LinuxSourceDefines
#define ConnectionFlags -DUNIXCONN -DTCPCONN

View file

@ -300,7 +300,7 @@ char *cpp_argv[ARGUMENTS] = {
#ifdef unix
"-Uunix", /* remove unix symbol so that filename unix.c okay */
#endif
#if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(MACH) || defined(ISC) || defined(linux) || defined(__hpux__) || defined(__vxworks)
#if defined(__386BSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(MACH) || defined(ISC) || defined(__linux__) || defined(__hpux__) || defined(__vxworks)
# ifdef __i386__
"-D__i386__",
# endif
@ -502,7 +502,7 @@ char *cpp_argv[ARGUMENTS] = {
#endif
#ifdef linux
"-traditional",
"-Dlinux",
"-D__linux__",
#endif
#ifdef __sxg__
"-D__sxg__",
@ -567,7 +567,7 @@ char *cpp_argv[ARGUMENTS] = {
# define DEFAULT_OS_MINOR_REV "r %[0-9]"
/* No information available to generate default OSTeenyVersion value. */
# define DEFAULT_OS_NAME "srvm %[^\n]"
#elif defined(sun) || defined(sgi) || defined(ultrix) || defined(linux) || defined(sony)
#elif defined(sun) || defined(sgi) || defined(ultrix) || defined(__linux__) || defined(sony)
/* uname -r returns "x.y[.z]", e.g. "5.4" or "4.1.3" */
# define DEFAULT_OS_MAJOR_REV "r %[0-9]"
# define DEFAULT_OS_MINOR_REV "r %*d.%[0-9]"
@ -689,7 +689,7 @@ struct symtab predefs[] = {
#ifdef mc68020
{"mc68020", "1"},
#endif
#if defined(__GNUC__) && !defined(linux)
#if defined(__GNUC__) && !defined(__linux__)
{"__GNUC__", DEF_STRINGIFY(__GNUC__)},
#endif
#ifdef __GNUC_MINOR__

View file

@ -59,7 +59,7 @@ extern "C" {
** System V R4 based systems define the stuff we need in
** sys/types.h. Include that and then we are done.
*/
#if defined(HPUX) || defined(linux) || defined(SunOS)
#if defined(HPUX) || defined(__linux__) || defined(SunOS)
#include <sys/types.h>
#endif
@ -110,7 +110,7 @@ typedef enum {B_FALSE, B_TRUE} boolean_t;
#endif /* HPUX */
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
typedef enum {B_FALSE, B_TRUE} boolean_t;
#define MAXNAMELEN 256

View file

@ -141,7 +141,7 @@ _DtCvRunInterp(
* write the data to file.
*/
result = -1;
#if defined(linux)
#if defined(__linux__)
myFd = open(fileName, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
#else
myFd = open(fileName, O_WRONLY | O_CREAT | O_TRUNC);

View file

@ -58,7 +58,7 @@
#include "CvStringI.h" /* for string functions used by Canvas Engine */
#include "StringFuncsI.h" /* for _CEStrcollProc */
#if !defined(linux)
#if !defined(__linux__)
# include <iconv.h>
#else
# define iconv_t int

View file

@ -62,11 +62,11 @@
#include <stdio.h>
#include <string.h>
#if defined(linux)
#if defined(__linux__)
# define __SVR4_I386_ABI_L1__
#endif
#include <limits.h>
#if defined(linux)
#if defined(__linux__)
# undef __SVR4_I386_ABI_L1__
# ifndef WORD_BIT
# define WORD_BIT 32

View file

@ -871,7 +871,7 @@ extern LLIST *sort_llist (LLIST *list_header);
extern char *teskey_parser (PARG *parg);
extern DtSrObjdate
tm2objdate (struct tm *tmptr);
#if !defined(linux)
#if !defined(__linux__)
#ifndef _ALL_SOURCE
extern char *strdup (const char *s);
#endif

View file

@ -82,11 +82,11 @@
* - Prefix all vista utility names with "dt...", also to deconfuse.
*
*/
#if defined(linux)
#if defined(__linux__)
# define __SVR4_I386_ABI_L1__
#endif
#include <limits.h> /* pickup WORD_BIT, LONG_BIT */
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
# undef __SVR4_I386_ABI_L1__
# ifndef WORD_BIT
# define WORD_BIT 32

View file

@ -202,7 +202,7 @@ void local_channel_object_input_handler(void * client_data,
timeout.tv_sec = 0;
timeout.tv_usec = 0;
#if defined(SVR4) || defined(__hpux) || defined(__OpenBSD__) || defined(linux)
#if defined(SVR4) || defined(__hpux) || defined(__OpenBSD__) || defined(__linux__)
select(max_fds, (fd_set*)&read_fd_vect, NULL, (fd_set*)&except_fd_vect, &timeout);
#else
/* UX has select defined with int*, not fd_set* parms */

View file

@ -36,7 +36,7 @@
#include <bms/stringbuf.h>
#include <termios.h>
#if !defined(linux) && !defined(CSRG_BASED)
#if !defined(__linux__) && !defined(CSRG_BASED)
#include <sys/termio.h>
#endif
#include <codelibs/stringx.h>

View file

@ -73,7 +73,7 @@
#include <Dt/Dts.h>
#include "DtSvcLock.h"
#if !defined(linux)
#if !defined(__linux__)
extern char *strdup(const char *);
#endif

View file

@ -58,7 +58,7 @@
#include "Dt/DtsDb.h"
#include "Dt/Dts.h"
#if !defined(linux)
#if !defined(__linux__)
extern char *strdup(const char *);
#endif

View file

@ -167,7 +167,7 @@ _DtSaverStart(
*/
if (saver_list.serial == 0)
{
#if !defined(linux) && !defined(CSRG_BASED)
#if !defined(__linux__) && !defined(CSRG_BASED)
/* JET - how can this ever work anyway? */
putenv(envdata);
envdata[0] = '\0';
@ -214,7 +214,7 @@ _DtSaverStart(
sprintf(pe, " %lx", XtWindow(drawArea[i]));
}
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
putenv(envdata);
#endif

View file

@ -68,7 +68,7 @@ struct strtab_build {
static void inc_it (int * a, int * b, unsigned char * key);
static void build_it(int a, struct strtab_build * ptr, unsigned char * key);
#if !defined(linux)
#if !defined(__linux__)
extern char * strdup(const char *);
#endif
typedef int (*des_func)(void *);

View file

@ -426,7 +426,7 @@ _DtEnvControl(
if ((ptr = strstr(tempString, "/usr/openwin/bin")))
#elif defined(CSRG_BASED)
if ((ptr = strstr(tempString, "/usr/X11R6/bin")))
#elif defined(linux)
#elif defined(__linux__)
if ((ptr = strstr(tempString, "/usr/bin")))
#else
if ((ptr = strstr(tempString, "/usr/bin/X11")))
@ -821,7 +821,7 @@ static void _EnvAdd
{
_DtSvcProcessLock();
if (envBitVector & bv_flag) {
#if defined(CSRG_BASED) || defined(linux)
#if defined(CSRG_BASED) || defined(__linux__)
setenv(envVar, envVarSetting + strlen(envVar) + 1, 1);
#else
@ -928,7 +928,7 @@ _DtEnvRemove(
&& ( p[len] == '=' )
&& !strncmp(p, str, len))
{
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
/* JET - 2/19/99
It seems much safer to let libc worry about this
rather than try to do it ourselves.

View file

@ -49,7 +49,7 @@ $END$
#include <sys/param.h> /* MAXPATHLEN */
/* for RADIXCHAR and nl_langinfo */
#if defined(linux)
#if defined(__linux__)
# define RADIXCHAR MON_DECIMAL_POINT
#endif
#include <langinfo.h>
@ -2199,7 +2199,7 @@ int _DtXlateGetXlateEnv(
/* then look up version number of execution host */
if (ret_AppExecEnvVersion)
{
#if defined(sun) || defined(_AIX) || defined(linux) || defined(CSRG_BASED)
#if defined(sun) || defined(_AIX) || defined(__linux__) || defined(CSRG_BASED)
char version[SYS_NMLN+SYS_NMLN+2];
#else
char version[UTSLEN+UTSLEN+2];
@ -2252,7 +2252,7 @@ int _DtXlateGetXlateEnv(
#error OSMAJORVERSION and/or OSMINORVERSION not defined
#endif
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
sprintf(buf,"%s%s%s", STR(OSMAJORVERSION),
nl_langinfo('.'), STR(OSMINORVERSION));
#else

View file

@ -255,7 +255,7 @@
/* about above. So, declare them only if we don't already have them */
/* ----------------------------------------------------------------- */
#if defined(_HPUX_SOURCE) || defined(__sun) || defined(_INCLUDE_BSD_SOURCE) || defined(__aix) || defined(linux)
#if defined(_HPUX_SOURCE) || defined(__sun) || defined(_INCLUDE_BSD_SOURCE) || defined(__aix) || defined(__linux__)
/* the "u_types" are defined in standard files */
# undef _INCLUDE_BSD_SOURCE
#else

View file

@ -62,7 +62,7 @@
#if !(defined(apollo) && defined(__bsd)) && !defined(CSRG_BASED)
#if defined(__STDC__)
#if !defined(linux) && !defined(_XFUNCS_H_) && !defined(sun)
#if !defined(__linux__) && !defined(_XFUNCS_H_) && !defined(sun)
extern void bcopy(char *b1, char *b2, int length);
extern int bcmp(char *b1, char *b2, int length);
extern void bzero(char *b, int length);
@ -70,7 +70,7 @@ extern void bzero(char *b, int length);
extern char *mktemp(char *tmplate);
#elif ! defined(__cplusplus)
#if !defined(linux) && !defined(_XFUNCS_H_)
#if !defined(__linux__) && !defined(_XFUNCS_H_)
extern void bcopy();
extern int bcmp();
extern void bzero();

View file

@ -36,10 +36,10 @@
#ifndef __DYNARRAY_H_
#define __DYNARRAY_H_
#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun)
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <generic.h>
#endif
#if defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#define _DELETE_ARRAY(sz) delete[]
#else
#define _DELETE_ARRAY(sz) delete[(sz)]

View file

@ -48,7 +48,7 @@ typedef void (*privbuf_func)(void *v);
#include <stddef.h>
#include <stdlib.h>
#if defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(sun) || defined(__linux__) || defined(CSRG_BASED)
// Rejects valid inline declarations, claiming they have both internal and
// external linkage.
#else

View file

@ -73,7 +73,7 @@ extern "C"
#ifdef __cplusplus
char *strtokx(char *&ptr, const char *sep);
# if !defined(linux) && !defined(sun) && !defined(CSRG_BASED)
# if !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
char **strsep(const char *str, const char *sep,
boolean whsp = TRUE, int *num = NULL);
const char *strcmbn(const char **vec, const char *sep = " ");
@ -81,7 +81,7 @@ extern "C"
#else /* __STDC__ */
char *strtokx(char **ptr, const char *sep);
# if !defined(linux) && !defined(sun) && !defined(CSRG_BASED)
# if !defined(__linux__) && !defined(sun) && !defined(CSRG_BASED)
char **strsep(const char *str, const char *sep,
boolean whsp, int *num);
#endif
@ -119,7 +119,7 @@ extern size_t nl_strlen(); /* __OBSOLETE */
#if defined(__cplusplus)
}
#if defined(apollo) || defined(__aix) || defined(linux) || defined(CSRG_BASED)
#if defined(apollo) || defined(__aix) || defined(__linux__) || defined(CSRG_BASED)
#include <stdlib.h>
#else
#include <malloc.h>

View file

@ -44,7 +44,7 @@
#include <Xm/Xm.h>
#include <X11/Xos.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#define _NFILE FOPEN_MAX
#endif

View file

@ -81,7 +81,7 @@ extern char * _DtTermPrimGetMessage( char *filename, int set, int n, char *s );
#include <ctype.h>
#include <nl_types.h>
#include <wchar.h>
#if defined(linux) || defined(hpV4)
#if defined(__linux__) || defined(hpV4)
# include <sys/types.h> /* For FD_* macros. */
# include <sys/time.h> /* For select() prototype. */
#else

View file

@ -39,7 +39,7 @@ static char rcs_id[] = "$XConsortium: TermPrimDebug.c /main/4 1996/11/21 19:58:1
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
# include <stdarg.h>
#else
# include <varargs.h>

View file

@ -49,7 +49,7 @@ static char rcs_id[] = "$TOG: TermPrimGetPty-clone.c /main/7 1998/04/03 17:11:08
#if defined(__AIX)
# define PTY_CLONE_DEVICE "/dev/ptc"
#elif defined(linux)
#elif defined(__linux__)
# define PTY_CLONE_DEVICE "/dev/ptyc"
#endif /* __AIX */
@ -72,7 +72,7 @@ GetPty(char **ptySlave, char **ptyMaster)
if ((ptyFd = open(*ptyMaster, O_RDWR, 0))) {
_Xttynameparams tty_buf;
#if defined(linux)
#if defined(__linux__)
if (c = _XTtyname(ptyFd)) {
#else
if (c = _XTtyname(ptyFd, tty_buf)) {

View file

@ -43,14 +43,14 @@ static char rcs_id[] = "$XConsortium: TermPrimGetPty-svr4.c /main/1 1996/04/21 1
#include "TermPrimOSDepI.h"
#include "TermPrimDebug.h"
#include "TermHeader.h"
#if !defined(linux)
#if !defined(__linux__)
#include <stropts.h>
#include <sys/conf.h>
#include <sys/stream.h>
#endif
#include <sys/termios.h>
#if defined(linux)
#if defined(__linux__)
#undef USE_STREAMS_BUFMOD
#endif
@ -260,7 +260,7 @@ SetupPty(char *ptySlave, int ptyFd)
* they don't seem to stick after the file is closed on
* SVR4.2. Not sure where else this applies.
*/
#if !defined(linux)
#if !defined(__linux__)
if (ioctl(ptyFd, I_PUSH, "ptem") == -1) {
(void) perror("Error pushing ptem");
/* exit the subprocess */

View file

@ -385,7 +385,7 @@ UtmpEntryCreate(Widget w, pid_t pid, char *utmpLine)
(void) strncpy(utPtr->ut_id, utmpLine,
sizeof(utPtr->ut_id));
#else /* __AIX */
#if defined(linux) || defined(sun)
#if defined(__linux__) || defined(sun)
if (c = strchr(utmpLine, '/')) {
c++;
} else {
@ -401,7 +401,7 @@ UtmpEntryCreate(Widget w, pid_t pid, char *utmpLine)
/* set up the new entry... */
utPtr->ut_type = USER_PROCESS;
#if !defined(linux)
#if !defined(__linux__)
utPtr->ut_exit.e_termination = 0;
utPtr->ut_exit.e_exit = 2;
#endif
@ -528,7 +528,7 @@ UtmpEntryDestroy(Widget w, char *utmpLine)
(void) setutent();
if (utPtr = getutline(&ut)) {
utPtr->ut_type = DEAD_PROCESS;
#if !defined(linux)
#if !defined(__linux__)
utPtr->ut_exit.e_termination = 0;
utPtr->ut_exit.e_exit = 0;
#endif

View file

@ -62,7 +62,7 @@
# include <wchar.h>
# endif
# include <libintl.h>
#elif defined(linux)
#elif defined(__linux__)
# include <wctype.h>
# define NO_putwc
#elif defined(CSRG_BASED)

View file

@ -34,7 +34,7 @@
#include <unistd.h>
#include <signal.h>
#include <rpc/rpc.h>
#if !defined(linux) && !defined(CSRG_BASED)
#if !defined(__linux__) && !defined(CSRG_BASED)
# include <poll.h>
#endif
#if defined(SunOS)
@ -200,7 +200,7 @@ _DtCm_destroy_agent()
extern void
_DtCm_process_updates()
{
#if defined(CSRG_BASED) || defined(linux)
#if defined(CSRG_BASED) || defined(__linux__)
int i, nfd;
fd_set rpc_bits;

View file

@ -33,11 +33,11 @@
#define X_INCLUDE_TIME_H
#define XOS_USE_NO_LOCKING
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>
#if defined(linux)
#if defined(__linux__)
#define SVR4
#endif

View file

@ -174,7 +174,7 @@ _csa_tick_to_iso8601(time_t tick, char *buf_out)
}
/* JET. This is horrible. */
#if !defined(linux) && !defined(CSRG_BASED)
#if !defined(__linux__) && !defined(CSRG_BASED)
if (getenv("TZ")) {
strncpy(tz_orig, getenv("TZ"), sizeof(tz_orig));

View file

@ -42,15 +42,15 @@
#endif
#define X_INCLUDE_PWD_H
#define XOS_USE_XT_LOCKING
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>
#if defined(linux)
#if defined(__linux__)
#define SVR4
#endif
#if !defined(linux)
#if !defined(__linux__)
extern char * strdup(const char *);
#endif

View file

@ -37,7 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "util/copyright.h"
#if defined(linux) || defined(sgi) || defined(CSRG_BASED)
#if defined(__linux__) || defined(sgi) || defined(CSRG_BASED)
#include <getopt.h>
#endif
#include "dbck.h"

View file

@ -35,7 +35,7 @@
#include "tt_options.h"
#include <errno.h>
#include <string.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#include <unistd.h>
#else
#if !defined(sun)

View file

@ -35,7 +35,7 @@
#include "tt_options.h"
#include <errno.h>
#include <string.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#include <unistd.h>
#else
#if !defined(sun)

View file

@ -68,7 +68,7 @@ extern "C" {
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(linux)
#if !defined(__linux__)
void exit(int);
#endif
#ifdef __cplusplus

View file

@ -39,7 +39,7 @@
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#if defined(linux)
#if defined(__linux__)
#include <unistd.h>
#endif
#if defined(sgi) || defined(CSRG_BASED)

View file

@ -58,7 +58,7 @@ typedef int Bool;
extern char *ProgramName;
#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun)
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
extern char *malloc(), *realloc();
#endif
int process_command(), auth_initialize(), auth_finalize();

View file

@ -217,7 +217,7 @@ main(int argc, char** argv, char **envp)
#if defined(HPUX)
int asize = sizeof(saddr);
#else
# if defined(linux) || defined(CSRG_BASED) || defined(sun)
# if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
socklen_t asize = sizeof(saddr);
# else
size_t asize = sizeof(saddr);

View file

@ -37,7 +37,7 @@
#include <stdlib.h>
#include <sys/param.h>
#include <sys/stat.h>
#if defined(linux) || defined(sun) || defined(CSRG_BASED)
#if defined(__linux__) || defined(sun) || defined(CSRG_BASED)
#include <unistd.h>
#else
#if !defined(sun)

View file

@ -33,7 +33,7 @@
*/
#include <errno.h>
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <unistd.h>
#else
#include <osfcn.h>

View file

@ -360,7 +360,7 @@ append_real_subtrees( _Tt_string_list_ptr realtrees, _Tt_string path )
/*
* basename() - Return the last component of a pathname.
*/
#if !defined(linux)
#if !defined(__linux__)
char *basename( char *pathname ) {
char *the_basename;

View file

@ -32,7 +32,7 @@
*
*/
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <unistd.h>
#else
#include <osfcn.h>

View file

@ -38,7 +38,7 @@
#include <string.h>
#include <unistd.h>
#include <signal.h>
#if defined(linux)
#if defined(__linux__)
# include <sys/poll.h>
#else
# include <poll.h>

View file

@ -44,7 +44,7 @@
#include "api/c/tt_c.h"
#include "api/c/api_handle.h"
#if defined(linux)
#if defined(__linux__)
// Avoid g++ compiler errors on linux.
#define typename typenm
#endif

View file

@ -47,7 +47,7 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/time.h>
#if defined(__STDC__) && !defined(linux) && !defined(CSRG_BASED)
#if defined(__STDC__) && !defined(__linux__) && !defined(CSRG_BASED)
extern "C" { extern int ioctl (int, int, ...) ; };
#endif
#include "util/tt_global_env.h"

View file

@ -118,7 +118,7 @@ base_constructor()
_Tt_message::
_Tt_message()
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
: _pattern_id(), _object(), _file(), _op(),
_otype(), _sender_ptype(), _handler_ptype(),
_api_id(), _status_string()

View file

@ -37,11 +37,11 @@
#define _TT_MP_RPC
#include "tt_options.h"
#if defined(linux)
#if defined(__linux__)
# define __SVR4_I386_ABI_L1__
#endif
#include <rpc/rpc.h>
#if defined(linux)
#if defined(__linux__)
# undef __SVR4_I386_ABI_L1__
#endif

View file

@ -212,7 +212,7 @@ init(_Tt_host_ptr &host, int program, int version,
// Set close-on-exec bit so a libtt client which forks and execs won't
// be short some fd's in the child.
#if defined(linux)
#if defined(__linux__)
// JET - for linux, we need to do this properly - I don't know
// how the original code below can be correct, so we'll do it
// differently.

View file

@ -34,7 +34,7 @@
#include "tt_options.h"
#include <stdio.h>
#include "mp/mp_stream_socket.h"
#if defined(linux)
#if defined(__linux__)
#include <sys/poll.h>
#else
#include <poll.h>
@ -170,7 +170,7 @@ init(int init_as_source)
return 0;
}
#else
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
socklen_t len;
#else
int len;
@ -437,7 +437,7 @@ accept()
{
if (_msgsock == -1) {
#ifndef OPT_TLI
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
socklen_t addrlen = sizeof(sockaddr_in);
#else
int addrlen = sizeof(sockaddr_in);

View file

@ -408,7 +408,7 @@
# undef OPT_TAR_HAS_EXCLUDE_OPTION
# define OPT_BUG_RPCINTR
#elif defined(linux)
#elif defined(__linux__)
# undef OPT_UNIX_SOCKET_RPC
# undef OPT_TLI

View file

@ -25,7 +25,7 @@
//%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
//%% (c) Copyright 1993, 1994 Novell, Inc.
//%% $TOG: tttk.C /main/5 1999/09/14 13:00:44 mgreess $
#if defined(linux)
#if defined(__linux__)
# include <sys/poll.h>
#else
# include <poll.h>

View file

@ -449,7 +449,7 @@ _Tt_string _tt_entrypt_to_string(_Tt_entry_pt fun)
return "tt_feature_enabled";
case TT_FEATURE_REQUIRED :
return "tt_feature_required";
#if defined(linux)
#if defined(__linux__)
case TT_API_CALL_LAST: return (char *) NULL;
#elif defined(OPT_CONST_CORRECT)
case TT_API_CALL_LAST: return (const char *) NULL;

View file

@ -47,7 +47,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#if defined(linux)
#if defined(__linux__)
# include <sys/poll.h>
#else
# include <poll.h>

View file

@ -48,11 +48,11 @@
# endif
#elif defined(OPT_CATGETS)
# if defined(linux)
# if defined(__linux__)
extern "C" {
# endif
# include <nl_types.h>
# if defined(linux)
# if defined(__linux__)
}
# endif
# if !defined(NL_CAT_LOCALE)

View file

@ -45,7 +45,7 @@ extern "C" in_addr_t inet_addr(const char *);
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun)
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <osfcn.h>
#endif

View file

@ -36,12 +36,12 @@
#define X_INCLUDE_NETDB_H
#define XOS_USE_XT_LOCKING
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#define index
#define rindex
#endif
#include <X11/Xos_r.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#undef index
#undef rindex
#endif

View file

@ -225,7 +225,7 @@ _Tt_ostream::operator <<(
return *this;
}
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
// This operator is being added to take care of uid_t and gid_t
const _Tt_ostream &
_Tt_ostream::operator <<(

View file

@ -86,7 +86,7 @@ class _Tt_ostream : public virtual _Tt_allocated {
const _Tt_ostream &operator <<(
int n
) const;
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
const _Tt_ostream &operator <<(
unsigned int n
) const;

View file

@ -34,7 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#if !defined(linux) && !defined(CSRG_BASED) && !defined(sun)
#if !defined(__linux__) && !defined(CSRG_BASED) && !defined(sun)
#include <osfcn.h>
#endif

View file

@ -49,12 +49,12 @@
/* Included after "util/tt_string.h" to avoid index/strchr conflicts. */
#define X_INCLUDE_DIRENT_H
#define XOS_USE_NO_LOCKING
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#define index
#define rindex
#endif
#include <X11/Xos_r.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#undef index
#undef rindex
#endif

View file

@ -54,7 +54,7 @@
#endif
#include <stdlib.h>
#include <ctype.h>
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <wctype.h>
#endif
#include "util/tt_string.h"

View file

@ -45,12 +45,12 @@
/* Included after "util/tt_string.h" to avoid index/strchr conflicts. */
#define X_INCLUDE_STRING_H
#define XOS_USE_NO_LOCKING
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#define index
#define rindex
#endif
#include <X11/Xos_r.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
#undef index
#undef rindex
#endif

View file

@ -41,7 +41,7 @@
#include "util/tt_trace_parser.h"
#include "util/tt_entry_pt_names.h"
#if defined (_AIX) || defined(hpux) || defined(linux) || defined(CSRG_BASED)
#if defined (_AIX) || defined(hpux) || defined(__linux__) || defined(CSRG_BASED)
#include <fcntl.h>
#endif

View file

@ -39,7 +39,7 @@ static char sccsid[] = "@(#)iscntl.c 1.8 94/11/17";
* Generic control function
*/
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
#include <stdarg.h>
#else
#include <varargs.h>
@ -79,7 +79,7 @@ static char sccsid[] = "@(#)iscntl.c 1.8 94/11/17";
typedef int (* intfunc)();
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
int
iscntl(int isfd, int func, ...)
#else
@ -94,7 +94,7 @@ iscntl(isfd, func, va_alist)
va_list pvar;
int ret;
#if defined(linux) || defined(CSRG_BASED) || defined(sun)
#if defined(__linux__) || defined(CSRG_BASED) || defined(sun)
va_start(pvar, func);
#else
va_start(pvar);

View file

@ -31,7 +31,7 @@
* Copyright (c) 1990 by Sun Microsystems, Inc.
*/
#include <stdlib.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
/*# include <g++/minmax.h>*/
#else
# include <macros.h>

View file

@ -26,7 +26,7 @@
//%% (c) Copyright 1993, 1994 Novell, Inc.
//%% $TOG: mp_ptype.C /main/4 1998/03/20 14:27:56 mgreess $
#include <stdlib.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
/*# include <g++/minmax.h>*/
#else
# include <macros.h>

View file

@ -49,7 +49,7 @@
#include <sys/uio.h>
#include <fcntl.h>
#include <unistd.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
/*# include <g++/minmax.h>*/
#else
# include <macros.h>

View file

@ -350,7 +350,7 @@ gettransient(int proto, int vers, int *sockp)
#ifndef OPT_TLI
int found;
int s;
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
socklen_t len;
#else
int len;
@ -399,7 +399,7 @@ gettransient(int proto, int vers, int *sockp)
}
int optval = 0;
#if !defined(linux)
#if !defined(__linux__)
if (setsockopt(s, SOL_SOCKET, SO_USELOOPBACK,
(char *)&optval, sizeof(optval)) == -1) {
}

View file

@ -35,7 +35,7 @@
* a procedure.
*/
#include <stdlib.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
/*# include <g++/minmax.h>*/
#else
# include <macros.h>

View file

@ -39,7 +39,7 @@
// databases.
//
#include <stdlib.h>
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
/*# include <g++/minmax.h>*/
#else
# include <macros.h>

View file

@ -49,7 +49,7 @@
#include <locale.h>
#include <sys/param.h> /* for MAXPATHLEN and MAXHOSTNAMELEN */
#if defined(sun) || defined(linux)
#if defined(sun) || defined(__linux__)
#include <crypt.h>
#include <shadow.h>
#endif
@ -403,7 +403,7 @@ SetGidUid ( unsigned short rgid, unsigned short ruid )
/* fix process gid */
#if defined(SVR4) || defined(_AIX)
setgid(rgid);
#elif defined(linux) || defined(CSRG_BASED)
#elif defined(__linux__) || defined(CSRG_BASED)
if(-1 == setregid(rgid, rgid)) {
fprintf(stderr, "SetGidUid: setregid failed on %d\n", rgid);
}
@ -416,7 +416,7 @@ SetGidUid ( unsigned short rgid, unsigned short ruid )
/* fix process uid */
#if defined (SVR4) || defined (_AIX)
setuid(ruid);
#elif defined(linux) || defined(CSRG_BASED)
#elif defined(__linux__) || defined(CSRG_BASED)
if(-1 == setreuid(ruid, ruid)) {
fprintf(stderr, "SetGidUid: setreuid failed on %d\n", ruid);
}

View file

@ -65,7 +65,7 @@
#define BRWS_DASH_WIDTH 3
#define BRWS_NUM_DASHES 3
#if !defined(linux)
#if !defined(__linux__)
/*
* Somehow the compiler is not picking up strdup()
* from string.h properly...

View file

@ -64,7 +64,7 @@
#include "abmf.h"
/* glibc considers CLK_TCK obsolete */
#if defined(linux) && !defined(CLK_TCK)
#if defined(__linux__) && !defined(CLK_TCK)
#define CLK_TCK CLOCKS_PER_SEC
#endif

View file

@ -279,7 +279,7 @@ printf_setval(GenCodeInfo genCodeInfo, ABObj obj, ...)
{
int return_value = 0;
File codeFile = genCodeInfo->code_file;
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
/* Define va_list in <va_list.h> as structure of char ** and int
* Sun define va_list as void * */
va_list paramList = { 0, 0 };

View file

@ -350,7 +350,7 @@ write_func_def_params(
va_list va_params
)
{
#if defined(__ppc) || defined(linux)
#if defined(__ppc) || defined(__linux__)
#define va_start_params() __va_copy(params, va_params)
#elif defined(CSRG_BASED)
#define va_start_params() va_copy(params, va_params)

View file

@ -66,7 +66,7 @@
extern "C" {
#endif
#if !defined(linux)
#if !defined(__linux__)
extern char *strdup(const char *);
#endif

View file

@ -70,7 +70,7 @@
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -57,7 +57,7 @@ static char sccsid[] = "$TOG: RFCMIME.c /main/11 1999/06/30 12:08:55 mgreess $";
#include <RFCMIME.h>
/* Iconv not defined for linux. Use the EUSCompat stubs instead. */
#if !defined(linux)
#if !defined(__linux__)
# include <iconv.h>
#endif
#include <EUSCompat.h>

View file

@ -132,7 +132,7 @@ static char sccsid[] = "@(#)calendarA.c 1.196 95/04/12 Copyr 1991 Sun Microsyst
#include "cmtt.h"
#endif
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos.h>

View file

@ -71,7 +71,7 @@ should be fixed in the future.
#include <langinfo.h>
/* Iconv not defined for linux. Use the EUSCompat stubs instead. */
#if !defined(linux)
#if !defined(__linux__)
# include <iconv.h>
#endif
#include <EUSCompat.h>

View file

@ -81,7 +81,7 @@ static char sccsid[] = "@(#)dayglance.c 1.76 95/04/24 Copyr 1991 Sun Microsystem
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -72,7 +72,7 @@
static Bool lookForButton(Display *, XEvent *, XPointer);
#if !defined(linux) && !defined(CSRG_BASED)
#if !defined(__linux__) && !defined(CSRG_BASED)
extern char *sys_errlist[];
#endif

View file

@ -60,7 +60,7 @@
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -69,7 +69,7 @@ static char sccsid[] = "@(#)format.c 1.27 95/01/19 Copyr 1991 Sun Microsystems,
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -102,7 +102,7 @@ static char sccsid[] = "@(#)monthglance.c 1.82 95/07/27 Copyr 1994 Sun Microsys
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -89,7 +89,7 @@ static char sccsid[] = "@(#)tempbr.c 1.48 95/03/28 Copyr 1991 Sun Microsystems,
static void tb_cancel_cb();
static void tb_close_cb();
static void tempbr_show_cb(Widget w, XtPointer data, XtPointer cbs);
#if defined(linux)
#if defined(__linux__)
#include <string.h>
#else
extern char *strdup(const char *);

View file

@ -78,7 +78,7 @@
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -70,7 +70,7 @@
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -88,7 +88,7 @@ static char sccsid[] = "@(#)yearglance.c 1.37 95/07/27 Copyr 1991 Sun Microsyste
#define XOS_USE_XT_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -58,11 +58,11 @@ static char sccsid[] = "@(#)timeops.c 1.13 95/05/02 Copyr 1991 Sun Microsystems,
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>
#if defined(linux)
#if defined(__linux__)
#define SVR4
#endif

View file

@ -69,7 +69,7 @@
#define X_INCLUDE_STRING_H
#define X_INCLUDE_TIME_H
#define XOS_USE_NO_LOCKING
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -35,7 +35,7 @@
#include <stdlib.h>
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -428,7 +428,7 @@ setinput (FILE* f)
return(-1);
}
#if !defined(linux)
#if !defined(__linux__)
/* no madvise so we lose this optimization */
madvise(start_of_mmapped_area, len, MADV_SEQUENTIAL);
#endif

View file

@ -39,7 +39,7 @@
#include <sys/file.h>
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if (defined(sun) && defined(_XOPEN_SOURCE)) || defined(linux)
#if (defined(sun) && defined(_XOPEN_SOURCE)) || defined(__linux__)
#include <time.h>
#endif
#include "csa.h"

View file

@ -30,7 +30,7 @@
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -30,7 +30,7 @@
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -30,7 +30,7 @@
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

View file

@ -31,7 +31,7 @@
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_TIME_H
#if defined(linux)
#if defined(__linux__)
#undef SVR4
#endif
#include <X11/Xos_r.h>

Some files were not shown because too many files have changed in this diff Show more