codegen: support hacked ABI if using pointer compression
[ajla.git] / cfg.h
blob00bc16612875f40af942feb23fcbf07e5a05bc39
1 /*
2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
9 * version.
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 #ifndef EWOULDBLOCK
20 #define EWOULDBLOCK EAGAIN
21 #endif
23 #define THREAD_WIN32_CYGWIN
25 #if defined(DEBUG_THREAD_NONE)
26 #define THREAD_NONE
27 #elif defined(__HAIKU__) && !defined(HAVE_PTHREAD_PREFER)
28 #define THREAD_HAIKU
29 #elif ((defined(OS_WIN32) && defined(HAVE__BEGINTHREADEX)) || (defined(OS_CYGWIN) && defined(THREAD_WIN32_CYGWIN) && defined(HAVE_PTHREAD))) && !defined(HAVE_PTHREAD_PREFER)
30 #define THREAD_WIN32
31 #elif defined(HAVE_PTHREAD)
32 #define THREAD_POSIX
33 #elif defined(OS_OS2) && (defined(_MT) || defined(__MULTI__) || defined(__MT__))
34 #define THREAD_OS2
35 #else
36 #define THREAD_NONE
37 #endif
39 #if defined(OS_OS2)
40 #define INCL_DOS
41 #define INCL_DOSERRORS
42 #define INCL_KBD
43 #define INCL_MOU
44 #define INCL_VIO
45 #include <os2.h>
46 #endif
48 #if defined(OS_WIN32) || defined(OS_CYGWIN)
49 #define WIN32_LEAN_AND_MEAN
50 #include <windows.h>
51 #endif
52 #if defined(OS_WIN32)
53 #include <winsock.h>
54 #endif
56 #if defined(__WATCOMC__) || defined(_WIN32)
57 #include <process.h>
58 #endif
60 #if defined(__STRICT_ANSI__) && !defined(mempcpy)
61 #undef HAVE_MEMPCPY
62 #endif