types.h (2866B)
1 /* -*-comment-start: "//";comment-end:""-*- 2 * GNU Mes --- Maxwell Equations of Software 3 * Copyright © 2017,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> 4 * 5 * This file is part of GNU Mes. 6 * 7 * GNU Mes is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 3 of the License, or (at 10 * your option) any later version. 11 * 12 * GNU Mes is distributed in the hope that it will be useful, but 13 * 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. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #ifndef __M2_TYPES_H 21 #define __M2_TYPES_H 1 22 23 // FIXME M2_Planet chokes on -1, even inside #if ! __M2__ 24 #if __arm__ || __i386__ 25 #define EOF 0xffffffff 26 #else 27 #define EOF 0xffffffffffffffff 28 #endif 29 30 /* 31 #ifndef __MES_CLOCK_T 32 #define __MES_CLOCK_T 33 #undef clock_t 34 typedef long clock_t; 35 #endif 36 */ 37 38 #ifndef __MES_DEV_T 39 #define __MES_DEV_T 40 #undef dev_t 41 typedef long dev_t; 42 #endif 43 44 /* 45 #if !defined (__MES_FILE_T) && ! defined (_FILE_T) 46 #define __MES_FILE_T 47 #define _FILE_T 48 typedef long FILE; 49 #endif 50 */ 51 52 #ifndef __MES_GID_T 53 #define __MES_GID_T 54 #undef gid_t 55 typedef unsigned gid_t; 56 #endif 57 58 #ifndef __MES_INO_T 59 #define __MES_INO_T 60 #undef ino_t 61 typedef unsigned ino_t; 62 #endif 63 64 #if __SIZEOF_LONG_LONG__ == 8 65 #ifndef __MES_INO64_T 66 #define __MES_INO64_T 67 #undef ino64_t 68 typedef unsigned ino64_t; 69 #endif 70 #endif // __SIZEOF_LONG_LONG__ == 8 71 72 #if !defined (__MES_INTPTR_T) && !defined (__intptr_t_defined) 73 #define __MES_INTPTR_T 74 #define __intptr_t_defined 75 #undef intptr_t 76 typedef long intptr_t; 77 #undef uintptr_t 78 typedef unsigned uintptr_t; 79 #endif 80 81 #ifndef __MES_OFF_T 82 #define __MES_OFF_T 83 #undef off_t 84 typedef long off_t; 85 #endif 86 87 #if __SIZEOF_LONG_LONG__ == 8 88 #ifndef __MES_OFF64_T 89 #define __MES_OFF64_T 90 #undef off64_t 91 typedef unsigned off64_t; 92 #endif 93 #endif // __SIZEOF_LONG_LONG__ == 8 94 95 #ifndef __MES_PID_T 96 #define __MES_PID_T 97 #undef pid_t 98 typedef int pid_t; 99 #endif 100 101 #ifndef __PTRDIFF_T 102 #define __PTRDIFF_T 103 #ifndef __MES_PTRDIFF_T 104 #define __MES_PTRDIFF_T 105 #undef ptrdiff_t 106 typedef long ptrdiff_t; 107 #endif 108 #endif 109 110 #ifndef __MES_SIGVAL_T 111 #define __MES_SIGVAL_T 112 #undef clock_t 113 typedef long sigval_t; 114 #endif 115 116 #ifndef __SIZE_T 117 #define __SIZE_T 118 #ifndef __MES_SIZE_T 119 #define __MES_SIZE_T 120 typedef unsigned size_t; 121 #endif 122 #endif 123 124 #ifndef __MES_SSIZE_T 125 #define __MES_SSIZE_T 126 #undef ssize_t 127 typedef long ssize_t; 128 #endif 129 130 #ifndef __MES_UID_T 131 #define __MES_UID_T 132 #undef uid_t 133 typedef unsigned uid_t; 134 #endif 135 136 #ifndef __WCHAR_T 137 #define __WCHAR_T 138 #ifndef __MES_WCHAR_T 139 #define __MES_WCHAR_T 140 #undef wchar_t 141 typedef int wchar_t; 142 #endif 143 #endif 144 145 #endif // __M2_TYPES_H