1 /*
2 * custom.h
3 *
4 * This file is for use on systems where Autoconf isn't quite able to
5 * get things right. It is appended to the bottom of config.h by configure,
6 * in order to override definitions from Autoconf that are erroneous. See
7 * the manual for more information.
8 *
9 * If you make additions to this file for your system, please send me
10 * the information, to arnold@skeeve.com.
11 */
12
13 /*
14 * Copyright (C) 1995-2004, 2008, 2009, 2011, 2016, 2018-2023,
15 * the Free Software Foundation, Inc.
16 *
17 * This file is part of GAWK, the GNU implementation of the
18 * AWK Programming Language.
19 *
20 * GAWK is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 3 of the License, or
23 * (at your option) any later version.
24 *
25 * GAWK is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
33 */
34
35 /* for VMS POSIX, from Pat Rankin, r.pat.rankin@gmail.com */
36 #ifdef VMS_POSIX
37 #undef VMS
38 #include "vms/redirect.h"
39 #endif
40
41 /* OpenVMS has some definitions in fp.h that should be in math.h */
42 /* From John Malmberg, wb8tyw@qsl.net */
43 #ifdef __VMS
44 #include <fp.h>
45 /* isnan () macro is broken */
46 #undef isnan
47 /* VMS has POSIX confirming limits.h */
48 #ifndef _REGEX_INCLUDE_LIMITS_H
49 #define _REGEX_INCLUDE_LIMITS_H 1
50 #endif
51 #ifndef _GNU_SOURCE
52 #define _GNU_SOURCE 1
53 #endif /* _GNU_SOURCE */
54 #ifndef SIZE_MAX
55 #define SIZE_MAX (__UINT32_MAX)
56 #endif /* SIZE_MAX */
57 #define ULONG_WIDTH 32
58 #ifndef __VAX
59 #ifndef ULLONG_MAX
60 #define ULLONG_MAX __UINT64_MAX
61 #endif /* ULLONG_MAX */
62 #endif /* __VAX */
63 #ifndef HAVE_STDINT_H
64 typedef char int_least8_t;
65 typedef unsigned char uint_least8_t;
66 typedef short int_least16_t;
67 typedef unsigned short uint_least16_t;
68 typedef unsigned long uint_fast32_t;
69 typedef long int_fast32_t;
70 #ifndef __VAX
71 typedef long long int_fast64_t;
72 typedef unsigned long long uint_fast64_t;
73 #endif /* __VAX */
74 #endif
75 /* All currently supported OpenVMS compilers appear to have HAVE_C_BOOL.
76 The generic config_h.com is used instead of configure is not able to
77 understand the extra code in config.h.in so it comments it out.
78 This code is needed to activate the stdbool.h
79 */
80 #if (defined(HAVE_C_BOOL) && defined(HAVE_STDBOOL_H))
81 #include <stdbool.h>
82 #endif
83 #endif /* __VMS */
84
85
86 /* For QNX, based on submission from Michael Hunter, mphunter@qnx.com */
87 #ifdef __QNX__
88 #define GETPGRP_VOID 1
89 #endif
90
91 /* For MacOS X, which is almost BSD Unix */
92 #ifdef __APPLE__
93 #define HAVE_MKTIME 1
94 #endif
95
96 /* For HP/UX with gcc */
97 #if defined(hpux) || defined(_HPUX_SOURCE)
98 #undef HAVE_TZSET
99 #define HAVE_TZSET 1
100 #define _TZSET 1
101 #endif
102
103 #if defined(_AIX)
104 #define _XOPEN_SOURCE_EXTENDED 1
105 #endif
106
107 #ifdef __MVS__
108 #ifndef _REGEX_INCLUDE_LIMITS_H
109 #define _REGEX_INCLUDE_LIMITS_H 1
110 #endif
111 #endif
112
113 /* Junk for dfa.[ch] */
114 /* The __pure__ attribute was added in gcc 2.96. */
115 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
116 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
117 #else
118 # define _GL_ATTRIBUTE_PURE /* empty */
119 #endif
120 #define FLEXIBLE_ARRAY_MEMBER 1
121 #define xreallocarray xnrealloc
122 #define xizalloc xzalloc
123 #define xicalloc xcalloc
124 #define xirealloc xrealloc
125 #define ximalloc xmalloc
126
127 #ifdef USE_PERSISTENT_MALLOC
128 #include <stdlib.h>
129 #include "pma.h"
130 #define malloc pma_malloc
131 #define calloc pma_calloc
132 #define realloc pma_realloc
133 #define free pma_free
134 #else /* ! USE_PERSISTENT_MALLOC */
135 #define pma_init(verbose, file) 0
136 #define pma_get_root() NULL
137 #define pma_set_root(rootptr) /* nothing */
138 #define pma_errno 0
139 #endif /* ! USE_PERSISTENT_MALLOC */
140
141 #ifndef HAVE_STRSIGNAL
142 char * strsignal(int signal);
143 #endif /* ! HAVE_STRSIGNAL */