maint: initialize MAINTAINERCLEANFILES
[gzip.git] / tailor.h
blobb2878b2e22ed739f9cf88ab0bf8babf69889cde8
1 /* tailor.h -- target dependent definitions
3 Copyright (C) 1997-1999, 2002, 2006, 2009-2024 Free Software Foundation,
4 Inc.
5 Copyright (C) 1992-1993 Jean-loup Gailly
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20 /* The target dependent definitions should be defined here only.
21 * The target dependent functions should be defined in tailor.c.
24 #if defined(__MSDOS__) && !defined(MSDOS)
25 # define MSDOS
26 #endif
28 #if defined(__OS2__) && !defined(OS2)
29 # define OS2
30 #endif
32 #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
33 # undef MSDOS
34 #endif
36 #ifdef MSDOS
37 # ifdef __GNUC__
38 /* DJGPP version 1.09+ on MS-DOS.
39 * The DJGPP 1.09 stat() function must be upgraded before gzip will
40 * fully work.
42 # define near
43 # else
44 # define MAXSEG_64K
45 # ifdef __TURBOC__
46 # define off_t long
47 # else /* MSC */
48 # define HAVE_SYS_UTIME_H
49 # endif
50 # endif
51 # define MAX_PATH_LEN 128
52 # define NO_MULTIPLE_DOTS
53 # define MAX_EXT_CHARS 3
54 # define Z_SUFFIX "z"
55 # define NO_SIZE_CHECK
56 # define UNLINK_READONLY_BUG
57 # define casemap(c) tolow(c) /* Force file names to lower case */
58 # include <io.h>
59 # define OS_CODE 0x00
60 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
61 # if !defined(NO_ASM) && !defined(ASMV)
62 # define ASMV
63 # endif
64 #else
65 # define near
66 #endif
68 #ifdef OS2
69 # define MAX_PATH_LEN 260
70 # ifdef OS2FAT
71 # define NO_MULTIPLE_DOTS
72 # define MAX_EXT_CHARS 3
73 # define Z_SUFFIX "z"
74 # define casemap(c) tolow(c)
75 # endif
76 # define UNLINK_READONLY_BUG
77 # include <io.h>
78 # define OS_CODE 0x06
79 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
80 # ifdef _MSC_VER
81 # define HAVE_SYS_UTIME_H
82 # define MAXSEG_64K
83 # undef near
84 # define near _near
85 # endif
86 # ifdef __EMX__
87 # define HAVE_SYS_UTIME_H
88 # define EXPAND(argc,argv) \
89 {_response(&argc, &argv); _wildcard(&argc, &argv);}
90 # endif
91 # ifdef __ZTC__
92 # define NO_DIR 1
93 # include <dos.h>
94 # define EXPAND(argc,argv) \
95 {response_expand(&argc, &argv);}
96 # endif
97 #endif
99 #if defined WIN32 || defined _WIN32
100 # define HAVE_SYS_UTIME_H
101 # define MAX_PATH_LEN 260
102 # define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
103 # define UNLINK_READONLY_BUG
104 # include <io.h>
105 # include <malloc.h>
106 # ifdef NTFAT
107 # define NO_MULTIPLE_DOTS
108 # define MAX_EXT_CHARS 3
109 # define Z_SUFFIX "z"
110 # define casemap(c) tolow(c) /* Force file names to lower case */
111 # endif
112 # define OS_CODE 0x0b
113 #endif
115 #ifdef MSDOS
116 # ifdef __TURBOC__
117 # include <alloc.h>
118 # define DYN_ALLOC
119 /* Turbo C 2.0 does not accept static allocations of large arrays */
120 void * fcalloc (unsigned items, unsigned size);
121 void fcfree (void *ptr);
122 # else /* MSC */
123 # include <malloc.h>
124 # define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
125 # define fcfree(ptr) hfree(ptr)
126 # endif
127 #else
128 # ifdef MAXSEG_64K
129 # define fcalloc(items,size) calloc((items),(size))
130 # else
131 # define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
132 # endif
133 # define fcfree(ptr) free(ptr)
134 #endif
136 #if defined(ATARI) || defined(atarist)
137 # define OS_CODE 0x05
138 # ifdef TOSFS
139 # define MAX_PATH_LEN 128
140 # define NO_MULTIPLE_DOTS
141 # define MAX_EXT_CHARS 3
142 # define Z_SUFFIX "z"
143 # define casemap(c) tolow(c) /* Force file names to lower case */
144 # endif
145 #endif
147 #ifdef TOPS20
148 # define OS_CODE 0x0a
149 #endif
151 #ifndef SIGPIPE
152 # define SIGPIPE 0
153 #endif
156 /* Common defaults */
158 #ifndef OS_CODE
159 # define OS_CODE 0x03 /* assume Unix */
160 #endif
162 #ifndef casemap
163 # define casemap(c) (c)
164 #endif
166 #ifndef OPTIONS_VAR
167 # define OPTIONS_VAR "GZIP"
168 #endif
170 #ifndef Z_SUFFIX
171 # define Z_SUFFIX ".gz"
172 #endif
174 #ifdef MAX_EXT_CHARS
175 # define MAX_SUFFIX MAX_EXT_CHARS
176 #else
177 # define MAX_SUFFIX 30
178 #endif
180 #ifndef MAKE_LEGAL_NAME
181 # ifdef NO_MULTIPLE_DOTS
182 # define MAKE_LEGAL_NAME(name) make_simple_name(name)
183 # else
184 # define MAKE_LEGAL_NAME(name)
185 # endif
186 #endif
188 #ifndef MIN_PART
189 # define MIN_PART 3
190 /* keep at least MIN_PART chars between dots in a file name. */
191 #endif
193 #ifndef EXPAND
194 # define EXPAND(argc,argv)
195 #endif
197 #ifndef SET_BINARY_MODE
198 # define SET_BINARY_MODE(fd)
199 #endif
201 #ifndef FALLTHROUGH
202 # if __GNUC__ < 7
203 # define FALLTHROUGH ((void) 0)
204 # else
205 # define FALLTHROUGH __attribute__ ((__fallthrough__))
206 # endif
207 #endif