1 ################################################################################
5 ## $Date: 2010/03/07 13:15:47 +0100 $
7 ################################################################################
9 ## Version 3.x, Copyright (C) 2004-2010, Marcus Holland-Moritz.
10 ## Version 2.x, Copyright (C) 2001, Paul Marquess.
11 ## Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
13 ## This program is free software; you can redistribute it and/or
14 ## modify it under the same terms as Perl itself.
16 ################################################################################
49 #ifndef PERL_UCHAR_MIN
50 # define PERL_UCHAR_MIN ((unsigned char)0)
53 #ifndef PERL_UCHAR_MAX
55 # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
58 # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
60 # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
65 #ifndef PERL_USHORT_MIN
66 # define PERL_USHORT_MIN ((unsigned short)0)
69 #ifndef PERL_USHORT_MAX
71 # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
74 # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
77 # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
79 # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
85 #ifndef PERL_SHORT_MAX
87 # define PERL_SHORT_MAX ((short)SHORT_MAX)
89 # ifdef MAXSHORT /* Often used in <values.h> */
90 # define PERL_SHORT_MAX ((short)MAXSHORT)
93 # define PERL_SHORT_MAX ((short)SHRT_MAX)
95 # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
101 #ifndef PERL_SHORT_MIN
103 # define PERL_SHORT_MIN ((short)SHORT_MIN)
106 # define PERL_SHORT_MIN ((short)MINSHORT)
109 # define PERL_SHORT_MIN ((short)SHRT_MIN)
111 # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
117 #ifndef PERL_UINT_MAX
119 # define PERL_UINT_MAX ((unsigned int)UINT_MAX)
122 # define PERL_UINT_MAX ((unsigned int)MAXUINT)
124 # define PERL_UINT_MAX (~(unsigned int)0)
129 #ifndef PERL_UINT_MIN
130 # define PERL_UINT_MIN ((unsigned int)0)
135 # define PERL_INT_MAX ((int)INT_MAX)
137 # ifdef MAXINT /* Often used in <values.h> */
138 # define PERL_INT_MAX ((int)MAXINT)
140 # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
147 # define PERL_INT_MIN ((int)INT_MIN)
150 # define PERL_INT_MIN ((int)MININT)
152 # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
157 #ifndef PERL_ULONG_MAX
159 # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
162 # define PERL_ULONG_MAX ((unsigned long)MAXULONG)
164 # define PERL_ULONG_MAX (~(unsigned long)0)
169 #ifndef PERL_ULONG_MIN
170 # define PERL_ULONG_MIN ((unsigned long)0L)
173 #ifndef PERL_LONG_MAX
175 # define PERL_LONG_MAX ((long)LONG_MAX)
178 # define PERL_LONG_MAX ((long)MAXLONG)
180 # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
185 #ifndef PERL_LONG_MIN
187 # define PERL_LONG_MIN ((long)LONG_MIN)
190 # define PERL_LONG_MIN ((long)MINLONG)
192 # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
197 #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
198 # ifndef PERL_UQUAD_MAX
199 # ifdef ULONGLONG_MAX
200 # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
203 # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
205 # define PERL_UQUAD_MAX (~(unsigned long long)0)
210 # ifndef PERL_UQUAD_MIN
211 # define PERL_UQUAD_MIN ((unsigned long long)0L)
214 # ifndef PERL_QUAD_MAX
216 # define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
219 # define PERL_QUAD_MAX ((long long)MAXLONGLONG)
221 # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
226 # ifndef PERL_QUAD_MIN
228 # define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
231 # define PERL_QUAD_MIN ((long long)MINLONGLONG)
233 # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
239 /* This is based on code from 5.003 perl.h */
242 __UNDEFINED__ IVTYPE int
243 __UNDEFINED__ IV_MIN PERL_INT_MIN
244 __UNDEFINED__ IV_MAX PERL_INT_MAX
245 __UNDEFINED__ UV_MIN PERL_UINT_MIN
246 __UNDEFINED__ UV_MAX PERL_UINT_MAX
248 __UNDEFINED__ IVSIZE INTSIZE
251 # if defined(convex) || defined(uts)
252 __UNDEFINED__ IVTYPE long long
253 __UNDEFINED__ IV_MIN PERL_QUAD_MIN
254 __UNDEFINED__ IV_MAX PERL_QUAD_MAX
255 __UNDEFINED__ UV_MIN PERL_UQUAD_MIN
256 __UNDEFINED__ UV_MAX PERL_UQUAD_MAX
258 __UNDEFINED__ IVSIZE LONGLONGSIZE
261 __UNDEFINED__ IVTYPE long
262 __UNDEFINED__ IV_MIN PERL_LONG_MIN
263 __UNDEFINED__ IV_MAX PERL_LONG_MAX
264 __UNDEFINED__ UV_MIN PERL_ULONG_MIN
265 __UNDEFINED__ UV_MAX PERL_ULONG_MAX
267 __UNDEFINED__ IVSIZE LONGSIZE
271 __UNDEFINED__ IVSIZE 8
272 __UNDEFINED__ PERL_QUAD_MIN IV_MIN
273 __UNDEFINED__ PERL_QUAD_MAX IV_MAX
274 __UNDEFINED__ PERL_UQUAD_MIN UV_MIN
275 __UNDEFINED__ PERL_UQUAD_MAX UV_MAX
277 __UNDEFINED__ IVTYPE long
278 __UNDEFINED__ IV_MIN PERL_LONG_MIN
279 __UNDEFINED__ IV_MAX PERL_LONG_MAX
280 __UNDEFINED__ UV_MIN PERL_ULONG_MIN
281 __UNDEFINED__ UV_MAX PERL_ULONG_MAX
286 # define IVSIZE LONGSIZE
288 # define IVSIZE 4 /* A bold guess, but the best we can make. */
292 __UNDEFINED__ UVTYPE unsigned IVTYPE
293 __UNDEFINED__ UVSIZE IVSIZE
300 RETVAL = IVSIZE == sizeof(IV);
307 RETVAL = UVSIZE == sizeof(UV);
314 RETVAL = sizeof(IVTYPE) == sizeof(IV);
321 RETVAL = sizeof(UVTYPE) == sizeof(UV);
327 ok(&Devel::PPPort::iv_size());
328 ok(&Devel::PPPort::uv_size());
329 ok(&Devel::PPPort::iv_type());
330 ok(&Devel::PPPort::uv_type());