summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/config.h
blob: 427636d0c2f24f10c56328a25fd4179108cf1b8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* config.h: All .c files include this first.

Copyright (C) 1995, 1996, 2006, 2007 Karl Berry.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/.  */

#ifndef WEB2C_CONFIG_H
#define WEB2C_CONFIG_H

#if defined (TEX_DLL) && (defined (WIN32) || defined (__CYGWIN__))
#ifdef MAKE_TEX_DLL
#define TEXDLL __declspec (dllexport)
#else /* ! MAKE_TEX_DLL */
#define TEXDLL __declspec (dllimport)
#endif
#else /* ! (TEX_DLL && (WIN32 || __CYGWIN__)) */
#define TEXDLL
#endif

/* The stuff from the path searching library.  */
#include <kpathsea/config.h>
#include <web2c/c-auto.h>

/* However, inline is a keyword in C++, and should never be #define'd.
   Apparently Autoconf does not know this, at least the ancient version
   we are stuck with.  (Even though the Autoconf *test* is #ifdef'd.)  */
#ifdef __cplusplus
#undef inline
#endif

#include <kpathsea/c-vararg.h>

/* How to open a binary file.  */
#include <kpathsea/c-fopen.h>

/* The smallest signed type: use `signed char' if ANSI C, `short' if
   char is unsigned, otherwise `char'.  */
#ifndef SCHAR_TYPE
#if __STDC__
#define SCHAR_TYPE signed char
#else /* not __STDC */
#ifdef __CHAR_UNSIGNED__
#define SCHAR_TYPE short
#else
#define SCHAR_TYPE char
#endif
#endif /* not __STDC__ */
#endif /* not SCHAR_TYPE */
typedef SCHAR_TYPE schar;

/* The type `integer' must be a signed integer capable of holding at
   least the range of numbers (-2^31)..(2^31-1).  If your compiler goes
   to great lengths to make programs fail, you might have to change this
   definition.  If this changes, you may have to modify
   web2c/fixwrites.c, since it generates code to do integer output using
   "%ld", and casts all integral values to be printed to `long'.
   
   If you define your own INTEGER_TYPE, you have to define your own
   INTEGER_MAX and INTEGER_MIN, too. */
#ifndef INTEGER_TYPE

#if SIZEOF_LONG > 4 && !defined (NO_DUMP_SHARE)
/* If we have 64-bit longs and want to share format files (with 32-bit
   machines), use `int'.  */
#define INTEGER_IS_INT
#endif

#ifdef INTEGER_IS_INT
#define INTEGER_TYPE int
#define INTEGER_MAX INT_MAX
#define INTEGER_MIN INT_MIN
#else
#define INTEGER_TYPE long
#define INTEGER_MAX LONG_MAX
#define INTEGER_MIN LONG_MIN
#endif /* not INTEGER_IS_INT */

#endif /* not INTEGER_TYPE */

typedef INTEGER_TYPE integer;

/* We need a type that's at least 64 bits wide.  */
#if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
  /* C99; this is easy */
  #include <stdint.h>
  #define LONGINTEGER_TYPE int_least64_t
  #define LONGINTEGER_MAX INT_LEAST64_MAX
  #define LONGINTEGER_MIN INT_LEAST64_MIN
#else
  /* C++ or <C99; let's hope long is 64bit */
  #define LONGINTEGER_TYPE long
  #define LONGINTEGER_MAX LONG_MAX
  #define LONGINTEGER_MIN LONG_MIN
#endif
typedef LONGINTEGER_TYPE longinteger;


/* I don't want to write a configure test for remove when all Unix
   machines have unlink.  But, for the sake of non-Unix machines that
   support ANSI C... */
#if !defined (unix) && !defined (__unix__) && defined (__STDC__) && !defined (unlink)
#define unlink remove
#endif

/* Window support on the Amiga is just for the Amiga.  */
#ifdef AMIGA
#define AMIGAWIN
#endif

/* Window support for WIN32 machines. */
#ifdef WIN32
#define WIN32WIN
#endif

/* strtol.c */
#ifndef HAVE_STRTOL
extern long strtol P3H(const char *, char **, int);
#endif

/* From uexit.c.  This is here because the lib/ and web2c/ routines
   themselves can use it, but they don't need cpascal.h.  */
extern void uexit P1H(int status);

/* usage.c */
extern void usage P1H(const_string progname);
extern void usagehelp P2H(const_string *message, const_string bug_email);

#endif /* not CONFIG_H */