| OLD | NEW |
| 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * | 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
| 9 * | 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 * and other provisions required by the GPL or the LGPL. If you do not delete | 33 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 34 * the provisions above, a recipient may use your version of this file under | 34 * the provisions above, a recipient may use your version of this file under |
| 35 * the terms of any one of the MPL, the GPL or the LGPL. | 35 * the terms of any one of the MPL, the GPL or the LGPL. |
| 36 * | 36 * |
| 37 * ***** END LICENSE BLOCK ***** */ | 37 * ***** END LICENSE BLOCK ***** */ |
| 38 | 38 |
| 39 #ifndef nptypes_h_ | 39 #ifndef nptypes_h_ |
| 40 #define nptypes_h_ | 40 #define nptypes_h_ |
| 41 | 41 |
| 42 /* | 42 /* |
| 43 * Header file for ensuring that C99 types ([u]int32_t and bool) and | 43 * Header file for ensuring that C99 types ([u]int32_t, [u]int64_t and bool) and |
| 44 * true/false macros are available. | 44 * true/false macros are available. |
| 45 */ | 45 */ |
| 46 | 46 |
| 47 #if defined(WIN32) || defined(OS2) | 47 #if defined(WIN32) || defined(OS2) |
| 48 /* | 48 /* |
| 49 * Win32 and OS/2 don't know C99, so define [u]int_16/32 here. The bool | 49 * Win32 and OS/2 don't know C99, so define [u]int_16/32/64 here. The bool |
| 50 * is predefined tho, both in C and C++. | 50 * is predefined tho, both in C and C++. |
| 51 */ | 51 */ |
| 52 typedef short int16_t; | 52 typedef short int16_t; |
| 53 typedef unsigned short uint16_t; | 53 typedef unsigned short uint16_t; |
| 54 typedef int int32_t; | 54 typedef int int32_t; |
| 55 typedef unsigned int uint32_t; | 55 typedef unsigned int uint32_t; |
| 56 typedef long long int64_t; |
| 57 typedef unsigned long long uint64_t; |
| 56 #elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || de
fined(HPUX) | 58 #elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || de
fined(HPUX) |
| 57 /* | 59 /* |
| 58 * AIX and SunOS ship a inttypes.h header that defines [u]int32_t, | 60 * AIX and SunOS ship a inttypes.h header that defines [u]int32_t, |
| 59 * but not bool for C. | 61 * but not bool for C. |
| 60 */ | 62 */ |
| 61 #include <inttypes.h> | 63 #include <inttypes.h> |
| 62 | 64 |
| 63 #ifndef __cplusplus | 65 #ifndef __cplusplus |
| 64 typedef int bool; | 66 typedef int bool; |
| 65 #define true 1 | 67 #define true 1 |
| 66 #define false 0 | 68 #define false 0 |
| 67 #endif | 69 #endif |
| 68 #elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD) | 70 #elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD) |
| 69 /* | 71 /* |
| 70 * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and | 72 * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and |
| 71 * u_int32_t. | 73 * u_int32_t. |
| 72 */ | 74 */ |
| 73 #include <sys/types.h> | 75 #include <sys/types.h> |
| 74 | 76 |
| 75 /* | 77 /* |
| 76 * BSD/OS ships no header that defines uint32_t, nor bool (for C) | 78 * BSD/OS ships no header that defines uint32_t, nor bool (for C) |
| 77 */ | 79 */ |
| 78 #if defined(bsdi) | 80 #if defined(bsdi) |
| 79 typedef u_int32_t uint32_t; | 81 typedef u_int32_t uint32_t; |
| 82 typedef u_int64_t uint64_t; |
| 80 | 83 |
| 81 #if !defined(__cplusplus) | 84 #if !defined(__cplusplus) |
| 82 typedef int bool; | 85 typedef int bool; |
| 83 #define true 1 | 86 #define true 1 |
| 84 #define false 0 | 87 #define false 0 |
| 85 #endif | 88 #endif |
| 86 #else | 89 #else |
| 87 /* | 90 /* |
| 88 * FreeBSD and OpenBSD define uint32_t and bool. | 91 * FreeBSD and OpenBSD define uint32_t and bool. |
| 89 */ | 92 */ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 109 * works. | 112 * works. |
| 110 */ | 113 */ |
| 111 #define bool int | 114 #define bool int |
| 112 #define true 1 | 115 #define true 1 |
| 113 #define false 0 | 116 #define false 0 |
| 114 #endif | 117 #endif |
| 115 #endif | 118 #endif |
| 116 #endif | 119 #endif |
| 117 | 120 |
| 118 #endif /* nptypes_h_ */ | 121 #endif /* nptypes_h_ */ |
| OLD | NEW |