Use POSIX macros for linux
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
#include <Dt/Dts.h>
|
||||
#include "DtSvcLock.h"
|
||||
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
extern char *strdup(const char *);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
#include "Dt/DtsDb.h"
|
||||
#include "Dt/Dts.h"
|
||||
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
extern char *strdup(const char *);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -68,7 +68,7 @@ extern "C" {
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if !defined(linux)
|
||||
#if !defined(__linux__)
|
||||
void exit(int);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <<(
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user