]> granicus.if.org Git - flex/commitdiff
redo integral types again; add flexint.h; change dependencies caused by adding flexin...
authorWill Estes <wlestes@users.sourceforge.net>
Thu, 10 Oct 2002 15:34:31 +0000 (15:34 +0000)
committerWill Estes <wlestes@users.sourceforge.net>
Thu, 10 Oct 2002 15:34:31 +0000 (15:34 +0000)
Makefile.am
configure.in
flex.skl
flexdef.h
flexint.h [new file with mode: 0644]

index d849e037f4bd0a47a4427b8871381707aa4f79bc..0a8c9e3f50394d5c92da254c8ef623aa996d5b05 100644 (file)
@@ -75,6 +75,7 @@ libfl_a_SOURCES = \
 
 noinst_HEADERS = \
        flexdef.h \
+       flexint.h \
        version.h \
        options.h \
        scanopt.h \
@@ -125,7 +126,7 @@ localedir = $(datadir)/locale
 AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I@includedir@ -I$(top_srcdir)/intl
 LIBS = @LIBINTL@ @LIBS@
 
-skel.c: flex.skl mkskel.sh
+skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
        $(m4) -P -DFLEX_MAJOR_VERSION=`echo $(VERSION)|cut -f 1 -d .` -DFLEX_MINOR_VERSION=`echo $(VERSION)|cut -f 2 -d .` -DFLEX_SUBMINOR_VERSION=`echo $(VERSION)|cut -f 3 -d .` $(srcdir)/flex.skl | $(SHELL) $(srcdir)/mkskel.sh  >skel.c
 
 $(man_MANS): $(srcdir)/main.c
@@ -135,27 +136,28 @@ $(man_MANS): $(srcdir)/main.c
 
 # Explicitly describe dependencies.
 # You can recreate this with `gcc -I. -MM *.c'
-buf.o: buf.c flexdef.h
-ccl.o: ccl.c flexdef.h
-dfa.o: dfa.c flexdef.h tables.h tables_shared.h
-ecs.o: ecs.c flexdef.h
-gen.o: gen.c flexdef.h tables.h tables_shared.h
+buf.o: buf.c flexdef.h flexint.h
+ccl.o: ccl.c flexdef.h flexint.h
+dfa.o: dfa.c flexdef.h flexint.h tables.h tables_shared.h
+ecs.o: ecs.c flexdef.h flexint.h
+gen.o: gen.c flexdef.h flexint.h tables.h tables_shared.h
 libmain.o: libmain.c
 libyywrap.o: libyywrap.c
-main.o: main.c flexdef.h version.h options.h scanopt.h tables.h \
+main.o: main.c flexdef.h flexint.h version.h options.h scanopt.h \
+ tables.h tables_shared.h
+misc.o: misc.c flexdef.h flexint.h tables.h tables_shared.h
+nfa.o: nfa.c flexdef.h flexint.h
+options.o: options.c options.h scanopt.h flexdef.h flexint.h
+parse.o: parse.c flexdef.h flexint.h tables.h tables_shared.h
+scan.o: scan.c flexdef.h flexint.h parse.h
+scanopt.o: scanopt.c flexdef.h flexint.h scanopt.h
+skel.o: skel.c flexdef.h flexint.h
+sym.o: sym.c flexdef.h flexint.h
+tables.o: tables.c flexdef.h flexint.h tables.h tables_shared.h
+tables_shared.o: tables_shared.c flexdef.h flexint.h tables.h \
  tables_shared.h
-misc.o: misc.c flexdef.h tables.h tables_shared.h
-nfa.o: nfa.c flexdef.h
-options.o: options.c options.h scanopt.h flexdef.h
-parse.o: parse.c flexdef.h tables.h tables_shared.h
-scan.o: scan.c flexdef.h parse.h
-scanopt.o: scanopt.c flexdef.h scanopt.h
-skel.o: skel.c flexdef.h
-sym.o: sym.c flexdef.h
-tables.o: tables.c flexdef.h tables.h tables_shared.h
-tables_shared.o: tables_shared.c flexdef.h tables.h tables_shared.h
-tblcmp.o: tblcmp.c flexdef.h
-yylex.o: yylex.c flexdef.h parse.h
+tblcmp.o: tblcmp.c flexdef.h flexint.h
+yylex.o: yylex.c flexdef.h flexint.h parse.h
 
 # Create a tags file.
 tags:
index 07cc8a3deae346989185254a4a470e88699f411f..f0e3daa785a46e773bd639d5c8f3f9884752d81d 100644 (file)
@@ -62,13 +62,12 @@ dnl checks for libraries
 dnl checks for header files
 
 AC_HEADER_STDC
-AC_CHECK_HEADERS(sys/types.h unistd.h stdbool.h)
+AC_CHECK_HEADERS(unistd.h stdbool.h  netinet/in.h)
 AC_CHECK_HEADERS(cunistd)
 
 dnl checks for types
 
 AC_TYPE_SIZE_T
-AC_CHECK_TYPES([int8_t, uint8_t])
 
 dnl checks for functions
 
index e232769c269cc61baa47b0e499d6aad73188f1eb..1ed8770cd76e99b5929bf1216bfbacef6969a3d9 100644 (file)
--- a/flex.skl
+++ b/flex.skl
@@ -43,64 +43,6 @@ m4_changecom
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
-
-/* We try to get some modern integral types defined */
-
-/* Exact integral types.  */
-
-/* Signed.  */
-
-typedef signed char int8_t;
-typedef short int int16_t;
-typedef int int32_t;
-
-# if __WORDSIZE == 64
-typedef long int int64_t;
-# else
-__extension__ typedef long long int int64_t;
-# endif
-
-/* Unsigned.  */
-
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-typedef unsigned int uint32_t;
-
-#if __WORDSIZE == 64
-typedef unsigned long int uint64_t;
-#else
-__extension__ typedef unsigned long long int uint64_t;
-#endif
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
 %pop
 
 %if-tables-serialization
@@ -108,6 +50,11 @@ __extension__ typedef unsigned long long int uint64_t;
 %endif
 /* end standard C headers. */
 
+%push
+%c-or-c++
+m4_include(`flexint.h')
+%pop
+
 %push
 %c++-only
 /* begin standard C++ headers. */
@@ -559,9 +506,7 @@ static void yy_fatal_error YY_PARAMS(( yyconst char msg[] YY_PROTO_LAST_ARG ));
 %pop
 %push
 %c++-only
-#ifdef HAVE_CUNISTD
 #include <cunistd>
-#endif
 %pop
 #endif /* !YY_NO_UNISTD_H */
 
index 3dab6c4f9c4b8658588e0ad5340e60290aa241ee..814a885c2b069d24aac493f8eebd5abc4efd491f 100644 (file)
--- a/flexdef.h
+++ b/flexdef.h
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
+#include "flexint.h"
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
 #define unspecified -1
 
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
 /* Special chk[] values marking the slots taking by end-of-buffer and action
  * numbers.
  */
diff --git a/flexint.h b/flexint.h
new file mode 100644 (file)
index 0000000..011305c
--- /dev/null
+++ b/flexint.h
@@ -0,0 +1,66 @@
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901
+#include <stdint.h>
+#else
+/* Exact integral types.  */
+
+/* Signed.  */
+
+#define int8_t signed char
+#define int16_t short int
+#define int32_t int
+
+# if __WORDSIZE == 64 || defined __arch64__
+#define int64_t long int
+# else
+#define int64_t long long int
+# endif
+
+/* Unsigned.  */
+
+#define uint8_t unsigned char
+#define uint16_t unsigned short int
+#define uint32_t unsigned int
+
+#if __WORDSIZE == 64 || defined __arch64__
+#define uint64_t unsigned long int
+#else
+#define uint64_t unsigned long long int
+#endif
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* not C99 system */
+
+#endif /* ! FLEXINT_H */