1 /* 2 * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 #ifndef __SOUNDDEFS_INCLUDED__ 27 #define __SOUNDDEFS_INCLUDED__ 28 29 30 // types for X_PLATFORM 31 #define X_WINDOWS 1 32 #define X_SOLARIS 2 33 #define X_LINUX 3 34 #define X_BSD 4 35 #define X_MACOSX 5 36 37 // types for X_ARCH 38 #define X_I586 1 39 #define X_SPARC 2 40 #define X_SPARCV9 3 41 #define X_IA64 4 42 #define X_AMD64 5 43 #define X_ZERO 6 44 #define X_ARM 7 45 #define X_PPC 8 46 #define X_AARCH64 9 47 48 // ********************************** 49 // Make sure you set X_PLATFORM and X_ARCH defines correctly. 50 // Everything depends upon this flag being setup correctly. 51 // ********************************** 52 53 #if (X_PLATFORM == X_MACOSX) && !defined(X_ARCH) 54 #if __x86_64__ 55 #define X_ARCH X_AMD64 56 #endif 57 #if __i386__ 58 #define X_ARCH X_I586 59 #endif 60 #endif 61 62 #if (!defined(X_PLATFORM) || !defined(X_ARCH)) 63 #error "You need to define X_PLATFORM and X_ARCH outside of the source. Use the types above." 64 #endif 65 66 67 // following is needed for _LP64 68 #if ((X_PLATFORM == X_SOLARIS) || (X_PLATFORM == X_LINUX) || (X_PLATFORM == X_MACOSX)) 69 #include <sys/types.h> 70 #endif 71 72 #if X_PLATFORM == X_WINDOWS 73 #ifndef WIN32_LEAN_AND_MEAN 74 #define WIN32_LEAN_AND_MEAN 75 #endif 76 #include <windows.h> 77 #endif /* X_PLATFORM == X_WINDOWS */ 78 79 80 /* 81 * These types are defined elsewhere for newer 32/64-bit Windows 82 * header files, but not on Solaris/Linux (X_PLATFORM != X_WINDOWS) 83 */ 84 #if (X_PLATFORM != X_WINDOWS) 85 86 typedef unsigned char UINT8; 87 typedef char INT8; 88 typedef short INT16; 89 typedef unsigned short UINT16; 90 #ifdef _LP64 91 typedef int INT32; 92 typedef unsigned int UINT32; 93 typedef unsigned long UINT64; 94 typedef long INT64; 95 #else /* _LP64 */ 96 typedef long INT32; 97 typedef unsigned long UINT32; 98 /* generic 64 bit ? */ 99 typedef unsigned long long UINT64; 100 typedef long long INT64; 101 #endif /* _LP64 */ 102 103 typedef unsigned long UINT_PTR; 104 typedef long INT_PTR; 105 106 #endif /* X_PLATFORM != X_WINDOWS */ 107 108 109 typedef unsigned char UBYTE; 110 typedef char SBYTE; 111 112 113 #undef TRUE 114 #undef FALSE 115 116 #ifndef TRUE 117 #define TRUE 1 118 #endif 119 120 #ifndef FALSE 121 #define FALSE 0 122 #endif 123 124 #undef NULL 125 #ifndef NULL 126 #define NULL 0L 127 #endif 128 129 130 131 132 #if X_PLATFORM == X_WINDOWS 133 #include <stdlib.h> 134 #define INLINE _inline 135 #endif 136 137 138 #if X_PLATFORM == X_SOLARIS 139 #define INLINE 140 #endif 141 142 143 #if X_PLATFORM == X_LINUX 144 #define INLINE inline 145 #endif 146 147 148 #if (X_PLATFORM == X_BSD) || (X_PLATFORM == X_MACOSX) 149 #define INLINE inline 150 #endif 151 152 153 #endif // __SOUNDDEFS_INCLUDED__