diff options
Diffstat (limited to 'soltools/cpp')
-rw-r--r-- | soltools/cpp/_nlist.c | 3 | ||||
-rw-r--r-- | soltools/cpp/_unix.c | 12 | ||||
-rw-r--r-- | soltools/cpp/cpp.h | 3 | ||||
-rw-r--r-- | soltools/cpp/makefile.mk | 10 |
4 files changed, 20 insertions, 8 deletions
diff --git a/soltools/cpp/_nlist.c b/soltools/cpp/_nlist.c index 9144f2b7e15e..a71085bfbbf9 100644 --- a/soltools/cpp/_nlist.c +++ b/soltools/cpp/_nlist.c @@ -3,9 +3,6 @@ #include <string.h> #include "cpp.h" -extern int stgetopt(int, char *const *, const char *); -extern char *optarg; -extern int optind; extern int Cplusplus; Nlist *kwdefined; char wd[128]; diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c index 5574bb3ecef7..5352f6f1f5f9 100644 --- a/soltools/cpp/_unix.c +++ b/soltools/cpp/_unix.c @@ -12,9 +12,15 @@ #include "cpp.h" +#if defined MACOSX || !defined HAVE_GETOPT extern int stgetopt(int, char *const *, const char *); -extern char *optarg, rcsid[]; +extern char *optarg; extern int optind; +#else +#include <getopt.h> +#endif + +extern char rcsid[]; int Pflag = 0; /* print no line information */ int Iflag = 0; /* print includes */ @@ -36,7 +42,11 @@ void Tokenrow tr; setup_kwtab(); +#if defined MACOSX || !defined HAVE_GETOPT while ((c = stgetopt(argc, argv, "NOPV:I:D:U:F:A:X:u:l:+")) != -1) +#else + while ((c = getopt(argc, argv, "NOPV:I:D:U:F:A:X:u:l:+")) != -1) +#endif switch (c) { case 'N': diff --git a/soltools/cpp/cpp.h b/soltools/cpp/cpp.h index da609dbe53c1..34e18579c35a 100644 --- a/soltools/cpp/cpp.h +++ b/soltools/cpp/cpp.h @@ -15,11 +15,8 @@ #define NULL 0 #endif -#ifndef __alpha typedef unsigned char uchar; -#endif - enum toktype { END, UNCLASS, NAME, NUMBER, STRING, CCON, NL, WS, DSHARP, diff --git a/soltools/cpp/makefile.mk b/soltools/cpp/makefile.mk index 818c27028345..533cf9a91ab7 100644 --- a/soltools/cpp/makefile.mk +++ b/soltools/cpp/makefile.mk @@ -45,7 +45,6 @@ LIBSALCPPRT=$(0) OBJFILES= \ $(OBJ)$/_cpp.obj \ $(OBJ)$/_eval.obj \ - $(OBJ)$/_getopt.obj \ $(OBJ)$/_include.obj \ $(OBJ)$/_lex.obj \ $(OBJ)$/_macro.obj \ @@ -54,6 +53,15 @@ OBJFILES= \ $(OBJ)$/_tokens.obj \ $(OBJ)$/_unix.obj +# nonstandard cpp options needed for Mac (-isysroot), +# needs the custom stgetopt defined here :/ +.IF "$(OS)" == "MACOSX" || "$(HAVE_GETOPT)" != "YES" +OBJFILES += $(OBJ)$/_getopt.obj +.ENDIF +.IF "$(HAVE_GETOPT)" == "YES" +CDEFS += -DHAVE_GETOPT +.ENDIF + APP1TARGET = $(TARGET) .IF "$(GUI)" != "OS2" APP1STACK = 1000000 |