1 /* 2 * Copyright 2007 Sun Microsystems, Inc. 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. Sun designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 * CA 95054 USA or visit www.sun.com if you need additional information or 23 * have any 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 35 // types for X_ARCH 36 #define X_I586 1 37 #define X_SPARC 2 38 #define X_SPARCV9 3 39 #define X_IA64 4 40 #define X_AMD64 5 41 #define X_ZERO 6 42 43 // ********************************** 44 // Make sure you set X_PLATFORM and X_ARCH defines correctly. 45 // Everything depends upon this flag being setup correctly. 46 // ********************************** 47 #if (!defined(X_PLATFORM) || !defined(X_ARCH)) 48 #error "You need to define X_PLATFORM and X_ARCH outside of the source. Use the types above." 49 #endif 50 51 52 // following is needed for _LP64 53 #if ((X_PLATFORM == X_SOLARIS) || (X_PLATFORM == X_LINUX)) 54 #include <sys/types.h> 55 #endif 56 57 #if X_PLATFORM == X_WINDOWS 58 #ifndef WIN32_LEAN_AND_MEAN 59 #define WIN32_LEAN_AND_MEAN 60 #endif 61 #include <windows.h> 62 #endif /* X_PLATFORM == X_WINDOWS */ 63 64 65 /* 66 * These types are defined elsewhere for newer 32/64-bit Windows 67 * header files, but not on Solaris/Linux (X_PLATFORM != X_WINDOWS) 68 */ 69 #if (X_PLATFORM != X_WINDOWS) 70 71 typedef unsigned char UINT8; 72 typedef char INT8; 73 typedef short INT16; 74 typedef unsigned short UINT16; 75 #ifdef _LP64 76 typedef int INT32; 77 typedef unsigned int UINT32; 78 typedef unsigned long UINT64; 79 typedef long INT64; 80 #else /* _LP64 */ 81 typedef long INT32; 82 typedef unsigned long UINT32; 83 /* generic 64 bit ? */ 84 typedef unsigned long long UINT64; 85 typedef long long INT64; 86 #endif /* _LP64 */ 87 88 typedef unsigned long UINT_PTR; 89 typedef long INT_PTR; 90 91 #endif /* X_PLATFORM != X_WINDOWS */ 92 93 94 typedef unsigned char UBYTE; 95 typedef char SBYTE; 96 97 98 #undef TRUE 99 #undef FALSE 100 101 #ifndef TRUE 102 #define TRUE 1 103 #endif 104 105 #ifndef FALSE 106 #define FALSE 0 107 #endif 108 109 #undef NULL 110 #ifndef NULL 111 #define NULL 0L 112 #endif 113 114 115 116 117 #if X_PLATFORM == X_WINDOWS 118 #include <stdlib.h> 119 #define INLINE _inline 120 #endif 121 122 123 #if X_PLATFORM == X_SOLARIS 124 #define INLINE 125 #endif 126 127 128 #if X_PLATFORM == X_LINUX 129 #define INLINE inline 130 #endif 131 132 133 #endif // __SOUNDDEFS_INCLUDED__