noinst_HEADERS = \
flexdef.h \
+ flexint.h \
version.h \
options.h \
scanopt.h \
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
# 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:
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
#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
%endif
/* end standard C headers. */
+%push
+%c-or-c++
+m4_include(`flexint.h')
+%pop
+
%push
%c++-only
/* begin standard C++ headers. */
%pop
%push
%c++-only
-#ifdef HAVE_CUNISTD
#include <cunistd>
-#endif
%pop
#endif /* !YY_NO_UNISTD_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.
*/
--- /dev/null
+/* 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 */