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

@@ -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>