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

@@ -54,7 +54,7 @@ $COPYRIGHT$:
#endif
/* Iconv not defined for linux. Use the EUSCompat stubs instead. */
#if !defined(linux)
#if !defined(__linux__)
# include <iconv.h>
#else
# include <EUSCompat.h>

View File

@@ -42,7 +42,7 @@
#endif
#include <ctype.h>
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#include <unistd.h>
#include <locale.h>
#endif
@@ -162,7 +162,7 @@ EXTERN char driver[20]
#if defined(_AIX)
INIT("AIX")
#endif
#if defined(linux)
#if defined(__linux__)
INIT("LINUX")
#endif
#if defined(sun)

View File

@@ -151,7 +151,7 @@ void basename(M_NOPAR)
*p = save;
#else
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__)
#define CONTRIB "/usr/hphelp/bin/"
/* get our path if we can */
@@ -996,7 +996,7 @@ int mb_getqualified ( qualname, unqualname )
char *qualname;
char *unqualname;
{
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__)
FILE *f;
#endif
char fn[FNAMELEN];
@@ -1020,7 +1020,7 @@ else
fnp = fn;
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__)
qualname[0] = '\0';
gp = qualname + strlen(qualname);
roomleft = roomleft - strlen(qualname);
@@ -1134,7 +1134,7 @@ do {
while (1);
*strrchr(qualname, CSEP) = '\0';
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__)
#else
strupr ( qualname );
#endif
@@ -2249,7 +2249,7 @@ while (name = m_cyclent(init, &type, &content, &wheredef))
#if defined(MSDOS)
m_openchk(&nullfile, "NUL", "w");
#else
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__)
m_openchk(&nullfile, "/dev/null", "w");
#else
m_openchk(&nullfile, "nullfile", "w");

View File

@@ -43,7 +43,7 @@
#endif
#include <ctype.h>
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#include <unistd.h>
#include <locale.h>
#include <fcntl.h>
@@ -178,7 +178,7 @@ EXTERN char dirsep
#if defined(MSDOS)
INIT('\\')
#else
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
INIT('/')
#else
****define directory separator here****
@@ -186,7 +186,7 @@ INIT('/')
#endif
;
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#define CSEP '/'
#define SSEP "/"
#else

View File

@@ -357,7 +357,7 @@ char *qualname;
char *unqualname;
#endif
{
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
FILE *f;
#endif
@@ -382,7 +382,7 @@ else
fnp = fn;
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
qualname[0] = '\0';
gp = qualname + strlen(qualname);
roomleft = roomleft - strlen(qualname);
@@ -496,7 +496,7 @@ do {
while (1);
*strrchr(qualname, CSEP) = '\0';
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#else
strupr ( qualname );
#endif

View File

@@ -44,7 +44,7 @@ int main(argc, argv)
{
M_WCHAR *wc_userdef;
#if defined(linux)
#if defined(__linux__)
m_outfile = stdout;
m_errfile = stderr;
#endif
@@ -90,7 +90,7 @@ static char sopt[] =
static char name[] = "m_name = '%s'\n" ;
static char literal[] = "m_literal = '%s'\n" ;
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__)
char buffer[M_LITLEN + 80] ;
#else
#define max4(a,b,c,d) (a>b&&a>c&&a>d) ? a : ((b>c&&b>d) ? b : (c>d ? c : d))

View File

@@ -439,7 +439,7 @@ M_PAREXTERN int m_argc ;
M_PAREXTERN char **m_argv ;
/* PARSER output file */
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
M_PAREXTERN FILE *m_outfile;
M_PAREXTERN FILE *m_errfile;
#else

View File

@@ -357,7 +357,7 @@ char *qualname;
char *unqualname;
#endif
{
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
FILE *f;
#endif
char fn[FNAMELEN];
@@ -381,7 +381,7 @@ else
fnp = fn;
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
qualname[0] = '\0';
gp = qualname + strlen(qualname);
roomleft = roomleft - strlen(qualname);
@@ -495,7 +495,7 @@ do {
while (1);
*strrchr(qualname, CSEP) = '\0';
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#else
strupr ( qualname );
#endif

View File

@@ -45,7 +45,7 @@ int main(argc, argv)
"prevcon=%d,token=%d,curcon=%d,scanval='%c'(%d),line=%d,netlevel=%d\n" ;
static char name[] = "m_name = '%s'\n" ;
static char literal[] = "m_literal = '%s'\n" ;
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__)
char buffer[M_LITLEN + 80] ;
#else
#define max4(a,b,c,d) (a>b&&a>c&&a>d) ? a : ((b>c&&b>d) ? b : (c>d ? c : d))
@@ -55,7 +55,7 @@ int main(argc, argv)
sizeof(literal) + M_LITLEN - 2)] ;
#endif
#if defined(linux)
#if defined(__linux__)
m_outfile = stdout;
m_errfile = stderr;
#endif

View File

@@ -437,7 +437,7 @@ M_PAREXTERN int m_argc ;
M_PAREXTERN char **m_argv ;
/* PARSER output file */
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
M_PAREXTERN FILE *m_outfile;
M_PAREXTERN FILE *m_errfile;
#else

View File

@@ -43,7 +43,7 @@
#endif
#include <ctype.h>
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(linux) || defined(CSRG_BASED)
#if defined(hpux) || defined(_AIX) || defined(sun) || defined(__linux__) || defined(CSRG_BASED)
#include <unistd.h>
#include <locale.h>
#include <fcntl.h>

View File

@@ -26,13 +26,13 @@
#include <sys/stat.h>
#include <sys/wait.h>
#if defined(linux)
#if defined(__linux__)
# include <sys/fcntl.h>
#endif
#include <errno.h>
#if defined(linux)
#if defined(__linux__)
#include <getopt.h>
#endif

View File

@@ -55,7 +55,7 @@ void main(argc, argv)
sizeof(literal) + M_LITLEN - 2)] ;
#endif
#if defined(linux)
#if defined(__linux__)
m_outfile = stdout;
m_errfile = stderr;
#endif

View File

@@ -437,7 +437,7 @@ M_PAREXTERN int m_argc ;
M_PAREXTERN char **m_argv ;
/* PARSER output file */
#if defined(linux) || defined(CSRG_BASED)
#if defined(__linux__) || defined(CSRG_BASED)
M_PAREXTERN FILE *m_outfile;
M_PAREXTERN FILE *m_errfile;
#else