| 1 |
/* Machine/OS specific configuration information for GNUstep |
| 2 |
|
| 3 |
Please NOTE - GSConfig.h is generated by the configure script from the |
| 4 |
file GSConfig.h.in - changes/fixes need to be made to the original file, |
| 5 |
not to the GSConfig.h generated from it. |
| 6 |
|
| 7 |
Copyright (C) 1998-2010 Free Software Foundation, Inc. |
| 8 |
|
| 9 |
Written by: Richard frith-Macdonald <[email protected]> |
| 10 |
|
| 11 |
This file is part of the GNUstep Base Library. |
| 12 |
|
| 13 |
This library is free software; you can redistribute it and/or |
| 14 |
modify it under the terms of the GNU Lesser General Public |
| 15 |
License as published by the Free Software Foundation; either |
| 16 |
version 2 of the License, or (at your option) any later version. |
| 17 |
|
| 18 |
This library is distributed in the hope that it will be useful, |
| 19 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 |
Library General Public License for more details. |
| 22 |
|
| 23 |
You should have received a copy of the GNU Lesser General Public |
| 24 |
License along with this library; if not, write to the Free |
| 25 |
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 26 |
Boston, MA 02111 USA. |
| 27 |
*/ |
| 28 |
|
| 29 |
#ifndef included_GSConfig_h |
| 30 |
#define included_GSConfig_h |
| 31 |
|
| 32 |
/* Check the compiler to see if we are building on/for ms-windows. |
| 33 |
* Whatever the compiler uses, we want a standard setting of _WIN64 |
| 34 |
* to indicate 64bit AND _WIN32 to indicate ms-windows. |
| 35 |
* These are defined by gcc, clang, and microsoft compilers anyway. |
| 36 |
*/ |
| 37 |
#if defined(__WIN32__) \ |
| 38 |
|| defined(__MS_WIN32__) \ |
| 39 |
|| defined(__MINGW32__) |
| 40 |
# if !defined(_WIN32) |
| 41 |
# define _WIN32 |
| 42 |
# endif |
| 43 |
#endif |
| 44 |
#if defined(__WIN64__) \ |
| 45 |
|| defined(__MS_WIN64__) \ |
| 46 |
|| defined(__MINGW64__) |
| 47 |
# if !defined(__WIN64__) |
| 48 |
# define __WIN64__ |
| 49 |
# endif |
| 50 |
# if !defined(_WIN32) |
| 51 |
# define _WIN32 |
| 52 |
# endif |
| 53 |
#endif |
| 54 |
|
| 55 |
/* Check to see if this is a MINGW build (all we currently support) |
| 56 |
*/ |
| 57 |
#if defined(__MINGW32__) || defined(__MINGW64__) |
| 58 |
# if !defined(__MINGW__) |
| 59 |
# define __MINGW__ |
| 60 |
# endif |
| 61 |
#endif |
| 62 |
|
| 63 |
// Make sure we expose the constants that we use in ObjC++ mode |
| 64 |
#ifndef __STDC_CONSTANT_MACROS |
| 65 |
#define __STDC_CONSTANT_MACROS 1 |
| 66 |
#endif |
| 67 |
#ifndef __STDC_LIMIT_MACROS |
| 68 |
#define __STDC_LIMIT_MACROS 1 |
| 69 |
#endif |
| 70 |
|
| 71 |
#if !defined(NeXT_Foundation_LIBRARY) |
| 72 |
|
| 73 |
/* An alternate to GS_FAKE_MAIN which forces the user to call the |
| 74 |
NSProcessInfo initialization in 'main', GS_FAKE_MAIN must also |
| 75 |
be undefined. */ |
| 76 |
#if 0 |
| 77 |
#define GS_PASS_ARGUMENTS 0 |
| 78 |
#endif |
| 79 |
|
| 80 |
#define GS_FAKE_MAIN 0 |
| 81 |
#if GS_FAKE_MAIN |
| 82 |
|
| 83 |
/* |
| 84 |
* NOTE - if GS_FAKE_MAIN (above) is set to 1, this hack applies - and you |
| 85 |
* must make sure that this file is included in any file that implements |
| 86 |
* the 'main()' function and links with the GNUstep base libarary. |
| 87 |
* You should NOT include this file in a program that does not link with |
| 88 |
* the base library. |
| 89 |
* This file is included automatically in NSObject.h and Foundation.h |
| 90 |
* |
| 91 |
* The Foundation classe NSProcessInfo need access to the argc, argv, |
| 92 |
* and env variables of the main() function. The purpose of this (ugly hack) |
| 93 |
* definition is to give the gstep-base library the opportunity to implement |
| 94 |
* its own main function with private access to the global vars. The private |
| 95 |
* main() implementation (in NSProcessInfo.m) will then call the user defined |
| 96 |
* gnustep_base_user_main() function. |
| 97 |
* |
| 98 |
* The original hack was - |
| 99 |
** Written by: Georg Tuparev, EMBL & Academia Naturalis, |
| 100 |
** Heidelberg, Germany |
| 101 |
** [email protected] |
| 102 |
** |
| 103 |
** NOTE! This is very dirty and dangerous trick. I spend several hours |
| 104 |
** on thinking and man pages browsing, but couldn't find better solution. |
| 105 |
** I know that I will spend 666 years in the Computer Hell for writing |
| 106 |
** this hack, and the master devil (Bully Boy) will send me to write |
| 107 |
** Windowz software. |
| 108 |
** BTW, for writing this hack I got personal congratulations from Dennis |
| 109 |
** Ritchie and Bjarne Stroustrup sent me a bunch of flowers and asked me |
| 110 |
** to participate in the standardization committee for C-- v.6.0 as |
| 111 |
** responsible for the new Tab-Overriding-Operator and Scope-Sensitive- |
| 112 |
** Comments ... but this makes my situation even worse ;-) |
| 113 |
** - Georg |
| 114 |
* |
| 115 |
* On some systems, there are other relatively clean workarounds, if this |
| 116 |
* applies to the system you are running on, your configuration script |
| 117 |
* should have set GS_FAKE_MAIN to zero, so that this define hack will |
| 118 |
* not be used. |
| 119 |
*/ |
| 120 |
|
| 121 |
#define main gnustep_base_user_main |
| 122 |
|
| 123 |
#endif /* GS_FAKE_MAIN */ |
| 124 |
#endif |
| 125 |
|
| 126 |
/* |
| 127 |
* Definition to specify if your processor stores words with the most |
| 128 |
* significant byte first (like Motorola and SPARC, unlike Intel and VAX). |
| 129 |
*/ |
| 130 |
#define GS_WORDS_BIGENDIAN 0 |
| 131 |
|
| 132 |
/* |
| 133 |
* Size definitions for standard types |
| 134 |
*/ |
| 135 |
#define GS_SIZEOF_SHORT 2 |
| 136 |
#define GS_SIZEOF_INT 4 |
| 137 |
#define GS_SIZEOF_LONG 8 |
| 138 |
#define GS_SIZEOF_LONG_LONG 8 |
| 139 |
#define GS_SIZEOF_FLOAT 4 |
| 140 |
#define GS_SIZEOF_DOUBLE 8 |
| 141 |
#define GS_SIZEOF_VOIDP 8 |
| 142 |
|
| 143 |
/* |
| 144 |
* Size information to be places in bits 5 and 6 of type encoding bytes |
| 145 |
* in archives (bits 0 to 4 are used for basic type info and bit 7 is |
| 146 |
* used to mark cross-references to previously encoded objects). |
| 147 |
*/ |
| 148 |
#define _GSC_S_SHT _GSC_I16 |
| 149 |
#define _GSC_S_INT _GSC_I32 |
| 150 |
#define _GSC_S_LNG _GSC_I64 |
| 151 |
#define _GSC_S_LNG_LNG _GSC_I64 |
| 152 |
|
| 153 |
/* |
| 154 |
* Type definitions for types with known sizes. |
| 155 |
*/ |
| 156 |
typedef signed char gss8; |
| 157 |
typedef unsigned char gsu8; |
| 158 |
typedef signed short gss16; |
| 159 |
typedef unsigned short gsu16; |
| 160 |
typedef signed int gss32; |
| 161 |
typedef unsigned int gsu32; |
| 162 |
typedef signed long gss64; |
| 163 |
typedef unsigned long gsu64; |
| 164 |
typedef struct { gsu8 a[16]; } gss128; |
| 165 |
typedef struct { gsu8 a[16]; } gsu128; |
| 166 |
typedef float gsf32; |
| 167 |
typedef double gsf64; |
| 168 |
|
| 169 |
/* |
| 170 |
* Integer type with same size as a pointer |
| 171 |
*/ |
| 172 |
typedef unsigned long gsuaddr; |
| 173 |
typedef long gssaddr; |
| 174 |
typedef gsuaddr gsaddr; |
| 175 |
|
| 176 |
/* |
| 177 |
* Do we have real 64-bit and 128-bit integers or are we just pretending. |
| 178 |
*/ |
| 179 |
#define GS_HAVE_I64 1 |
| 180 |
#define GS_HAVE_I128 0 |
| 181 |
|
| 182 |
/* |
| 183 |
* Ensure some standard types are defined. |
| 184 |
*/ |
| 185 |
#include <inttypes.h> |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
/* |
| 198 |
* PTR Limit information replacements for buggy headers |
| 199 |
*/ |
| 200 |
#if 0 |
| 201 |
#undef INTPTR_MAX |
| 202 |
#define INTPTR_MAX |
| 203 |
#undef INTPTR_MIN |
| 204 |
#define INTPTR_MIN |
| 205 |
#undef UINTPTR_MAX |
| 206 |
#define UINTPTR_MAX |
| 207 |
#endif |
| 208 |
|
| 209 |
|
| 210 |
/* |
| 211 |
* Do we have zlib for file handle compression? |
| 212 |
*/ |
| 213 |
#define USE_ZLIB 1 |
| 214 |
|
| 215 |
/* |
| 216 |
* Do we have the GNU Multiple-precision library for NSDecimal? |
| 217 |
*/ |
| 218 |
//#define USE_GMP 1 |
| 219 |
#define USE_GMP 0 |
| 220 |
|
| 221 |
#ifdef GS_WITH_GC |
| 222 |
#undef GS_WITH_GC |
| 223 |
#endif |
| 224 |
#define GS_WITH_GC 0 |
| 225 |
|
| 226 |
/* |
| 227 |
* Define to say if we use NXConstantString or NSConstantString |
| 228 |
*/ |
| 229 |
#define NXConstantString NSConstantString |
| 230 |
|
| 231 |
|
| 232 |
/* |
| 233 |
* Wide unicode character type. |
| 234 |
*/ |
| 235 |
#ifndef UTF32Char |
| 236 |
#define UTF32Char uint32_t |
| 237 |
#endif |
| 238 |
|
| 239 |
/* |
| 240 |
* Native character type for use in systemcalls etc. |
| 241 |
*/ |
| 242 |
|
| 243 |
#if defined(__MINGW__) |
| 244 |
# define GSNativeChar uint16_t |
| 245 |
#else |
| 246 |
# define GSNativeChar char |
| 247 |
#endif |
| 248 |
|
| 249 |
/* |
| 250 |
* Types used to avoid exposing pthread header in NSLock.h |
| 251 |
* NB. These types should *never* be used except to provide enough space |
| 252 |
* in a class layout for the type of data actually used by the pthread |
| 253 |
* implementation of the current platform. |
| 254 |
*/ |
| 255 |
typedef struct { |
| 256 |
uint8_t dummy[48]; |
| 257 |
} gs_cond_t __attribute__((aligned (8))); |
| 258 |
typedef struct { |
| 259 |
uint8_t dummy[40]; |
| 260 |
} gs_mutex_t __attribute__((aligned (8))); |
| 261 |
|
| 262 |
#define OBJC2RUNTIME 1 |
| 263 |
#define BASE_NATIVE_OBJC_EXCEPTIONS 1 |
| 264 |
#define GS_NONFRAGILE 0 |
| 265 |
#define GS_MIXEDABI 0 |
| 266 |
#define GS_USE_LIBXML 0 |
| 267 |
#define GS_USE_GNUTLS 0 |
| 268 |
#define GS_USE_AVAHI 0 |
| 269 |
#define GS_USE_MDNS 0 |
| 270 |
#define GS_USE_ICU 0 |
| 271 |
#define GS_USE_LIBDISPATCH 0 |
| 272 |
#define GS_USE_LIBDISPATCH_RUNLOOP 0 |
| 273 |
#define GS_HAVE_OBJC_ROOT_CLASS_ATTR 0 |
| 274 |
|
| 275 |
#ifndef __has_include |
| 276 |
# define __has_include(x) 0 |
| 277 |
#endif |
| 278 |
#ifndef __has_feature |
| 279 |
# define __has_feature(x) 0 |
| 280 |
#endif |
| 281 |
#ifndef __has_builtin |
| 282 |
# define __has_builtin(x) 0 |
| 283 |
#endif |
| 284 |
|
| 285 |
/* |
| 286 |
* __has_extension has slightly different semantics from __has_feature. |
| 287 |
* It evaluates to true if the feature is supported by by clang for the |
| 288 |
* current compilation unit (language and -f switches), regardless of |
| 289 |
* whether it is part of the language standard or just a (non-standard) |
| 290 |
* extension. |
| 291 |
*/ |
| 292 |
#ifndef __has_extension |
| 293 |
# define __has_extension(x) __has_feature(x) |
| 294 |
#endif |
| 295 |
|
| 296 |
#if defined(_WIN32) |
| 297 |
#define BOOL WinBOOL |
| 298 |
#define __OBJC_BOOL 1 |
| 299 |
#include <w32api.h> |
| 300 |
#ifndef _WIN32_WINNT |
| 301 |
#define _WIN32_WINNT Windows2000 |
| 302 |
#endif |
| 303 |
#if !defined(WINVER) |
| 304 |
#define WINVER Windows2000 |
| 305 |
#elif (WINVER < Windows2000) |
| 306 |
#undef WINVER |
| 307 |
#define WINVER Windows2000 |
| 308 |
#endif |
| 309 |
|
| 310 |
#if defined(__WIN64__) |
| 311 |
#include <winsock2.h> |
| 312 |
#include <windows.h> |
| 313 |
#else |
| 314 |
#include <windows.h> |
| 315 |
#include <winsock2.h> |
| 316 |
#endif |
| 317 |
|
| 318 |
#undef __OBJC_BOOL |
| 319 |
#undef BOOL |
| 320 |
#endif |
| 321 |
|
| 322 |
/* Include the blocks runtime header if it's available (It shouldn't matter |
| 323 |
* that this doesn't work on compilers that don't support __has_include(), |
| 324 |
* because they also don't support blocks). |
| 325 |
*/ |
| 326 |
#if __has_include(<objc/block_runtime.h>) |
| 327 |
# include <objc/block_runtime.h> |
| 328 |
#endif |
| 329 |
|
| 330 |
#ifndef _WIN32 |
| 331 |
#include <sys/param.h> /* Hack to get rid of warning in GNU libc 2.0.3. */ |
| 332 |
#endif |
| 333 |
|
| 334 |
/* The following group of lines maintained by the gstep-base configure */ |
| 335 |
#define GNUSTEP_BASE_VERSION 1.26.0 |
| 336 |
#define GNUSTEP_BASE_MAJOR_VERSION 1 |
| 337 |
#define GNUSTEP_BASE_MINOR_VERSION 26 |
| 338 |
#define GNUSTEP_BASE_SUBMINOR_VERSION 0 |
| 339 |
#define GNUSTEP_BASE_GCC_VERSION 4.0.0 |
| 340 |
|
| 341 |
/* Do not use the following macros! |
| 342 |
*/ |
| 343 |
#define OBJC_DEP(M) \ |
| 344 |
({ static BOOL beenHere = NO; if (beenHere == NO) {\ |
| 345 |
beenHere = YES; fprintf(stderr, "%s:%d %s", __FILE__, __LINE__, (M));}}) |
| 346 |
|
| 347 |
#define OBJC_MALLOC(VAR, TYPE, NUM) \ |
| 348 |
(OBJC_DEP("OBJC_MALLOC is deprecated ... use malloc\n"),(VAR) = (TYPE *) malloc ((unsigned)(NUM)*sizeof(TYPE))) |
| 349 |
#define OBJC_VALLOC(VAR, TYPE, NUM) \ |
| 350 |
(OBJC_DEP("OBJC_VALLOC is deprecated\n"),(VAR) = (TYPE *) valloc ((unsigned)(NUM)*sizeof(TYPE))) |
| 351 |
#define OBJC_ATOMIC_MALLOC(VAR, TYPE, NUM) \ |
| 352 |
(OBJC_DEP("OBJC_ATOMIC_MALLOC is deprecated\n"),(VAR) = (TYPE *) malloc ((unsigned)(NUM)*sizeof(TYPE))) |
| 353 |
#define OBJC_REALLOC(VAR, TYPE, NUM) \ |
| 354 |
(OBJC_DEP("OBJC_REALLOC is deprecated ... use realloc\n"),(VAR) = (TYPE *) realloc ((VAR), (unsigned)(NUM)*sizeof(TYPE))) |
| 355 |
#define OBJC_CALLOC(VAR, TYPE, NUM) \ |
| 356 |
(OBJC_DEP("OBJC_CALLOC is deprecated ... use calloc\n"),(VAR) = (TYPE *) calloc ((unsigned)(NUM), sizeof(TYPE))) |
| 357 |
#define OBJC_FREE(PTR) (OBJC_DEP("OBJC_FREE is deprecated ... use free\n"), free (PTR)) |
| 358 |
|
| 359 |
#ifndef MAX |
| 360 |
#define MAX(a,b) \ |
| 361 |
({__typeof__(a) _MAX_a = (a); __typeof__(b) _MAX_b = (b); \ |
| 362 |
_MAX_a > _MAX_b ? _MAX_a : _MAX_b; }) |
| 363 |
#endif |
| 364 |
|
| 365 |
#ifndef MIN |
| 366 |
#define MIN(a,b) \ |
| 367 |
({__typeof__(a) _MIN_a = (a); __typeof__(b) _MIN_b = (b); \ |
| 368 |
_MIN_a < _MIN_b ? _MIN_a : _MIN_b; }) |
| 369 |
#endif |
| 370 |
|
| 371 |
#ifndef ABS |
| 372 |
#define ABS(a) \ |
| 373 |
({__typeof__(a) _ABS_a = (a); \ |
| 374 |
_ABS_a < 0 ? -_ABS_a : _ABS_a; }) |
| 375 |
#endif |
| 376 |
|
| 377 |
#ifndef STRINGIFY |
| 378 |
#define STRINGIFY(s) XSTRINGIFY(s) |
| 379 |
#define XSTRINGIFY(s) #s |
| 380 |
#endif |
| 381 |
|
| 382 |
#ifndef OBJC_STRINGIFY |
| 383 |
#define OBJC_STRINGIFY(s) OBJC_XSTRINGIFY(s) |
| 384 |
#define OBJC_XSTRINGIFY(s) @#s |
| 385 |
#endif |
| 386 |
|
| 387 |
#ifndef PTR2LONG |
| 388 |
#define PTR2LONG(P) (((char*)(P))-(char*)0) |
| 389 |
#endif |
| 390 |
#ifndef LONG2PTR |
| 391 |
#define LONG2PTR(L) (((char*)0)+(L)) |
| 392 |
#endif |
| 393 |
|
| 394 |
#if VSPRINTF_RETURNS_LENGTH |
| 395 |
#define VSPRINTF_LENGTH(VSPF_CALL) (VSPF_CALL) |
| 396 |
#else |
| 397 |
#define VSPRINTF_LENGTH(VSPF_CALL) strlen((VSPF_CALL)) |
| 398 |
#endif /* VSPRINTF_RETURNS_LENGTH */ |
| 399 |
|
| 400 |
#if VASPRINTF_RETURNS_LENGTH |
| 401 |
#define VASPRINTF_LENGTH(VASPF_CALL) (VASPF_CALL) |
| 402 |
#else |
| 403 |
#define VASPRINTF_LENGTH(VASPF_CALL) strlen((VASPF_CALL)) |
| 404 |
#endif /* VSPRINTF_RETURNS_LENGTH */ |
| 405 |
|
| 406 |
/* Evil hack to stop gcc-4.1 complaining about a dealloc method which |
| 407 |
* does not call the superclass implementation. |
| 408 |
*/ |
| 409 |
#define GSNOSUPERDEALLOC if (0) [super dealloc] |
| 410 |
|
| 411 |
#ifndef CF_EXCLUDE_CSTD_HEADERS |
| 412 |
#include <sys/types.h> |
| 413 |
#include <stdarg.h> |
| 414 |
#include <assert.h> |
| 415 |
#include <ctype.h> |
| 416 |
#include <errno.h> |
| 417 |
#include <float.h> |
| 418 |
#include <limits.h> |
| 419 |
#include <locale.h> |
| 420 |
#include <math.h> |
| 421 |
#include <setjmp.h> |
| 422 |
#include <signal.h> |
| 423 |
#include <stddef.h> |
| 424 |
#include <stdio.h> |
| 425 |
#include <stdlib.h> |
| 426 |
#include <string.h> |
| 427 |
#include <time.h> |
| 428 |
#include <stdbool.h> |
| 429 |
#endif |
| 430 |
|
| 431 |
#if !__has_feature(objc_arc) |
| 432 |
// NetBSD > 6 defines __weak in cdefs_elf.h |
| 433 |
#ifdef __NetBSD__ |
| 434 |
#undef __weak |
| 435 |
#endif |
| 436 |
# if !defined(__weak) |
| 437 |
# define __weak |
| 438 |
# endif |
| 439 |
# if !defined(__strong) |
| 440 |
# define __strong |
| 441 |
# endif |
| 442 |
#endif |
| 443 |
|
| 444 |
#ifndef __unsafe_unretained |
| 445 |
# if !__has_feature(objc_arc) |
| 446 |
# define __unsafe_unretained |
| 447 |
# endif |
| 448 |
#endif |
| 449 |
#ifndef __bridge |
| 450 |
# if !__has_feature(objc_arc) |
| 451 |
# define __bridge |
| 452 |
# endif |
| 453 |
#endif |
| 454 |
|
| 455 |
#if __has_builtin(__builtin_unreachable) |
| 456 |
# define GS_UNREACHABLE() __builtin_unreachable() |
| 457 |
#else |
| 458 |
# define GS_UNREACHABLE() abort() |
| 459 |
#endif |
| 460 |
|
| 461 |
#endif /* included_GSConfig_h */ |
| 462 |
|