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 
  47 // **********************************
  48 // Make sure you set X_PLATFORM and X_ARCH defines correctly.
  49 // Everything depends upon this flag being setup correctly.
  50 // **********************************
  51 
  52 #if (X_PLATFORM == X_MACOSX) && !defined(X_ARCH)
  53 #if __x86_64__
  54 #define X_ARCH X_AMD64
  55 #endif
  56 #if __i386__
  57 #define X_ARCH X_I586
  58 #endif
  59 #endif
  60 
  61 #if (!defined(X_PLATFORM) || !defined(X_ARCH))
  62 #error "You need to define X_PLATFORM and X_ARCH outside of the source. Use the types above."
  63 #endif
  64 
  65 
  66 // following is needed for _LP64
  67 #if ((X_PLATFORM == X_SOLARIS) || (X_PLATFORM == X_LINUX) || (X_PLATFORM == X_MACOSX))
  68 #include <sys/types.h>
  69 #endif
  70 
  71 #if X_PLATFORM == X_WINDOWS
  72 #ifndef WIN32_LEAN_AND_MEAN
  73 #define WIN32_LEAN_AND_MEAN
  74 #endif
  75 #include <windows.h>
  76 #endif /* X_PLATFORM == X_WINDOWS */
  77 
  78 
  79 /*
  80 * These types are defined elsewhere for newer 32/64-bit Windows
  81 * header files, but not on Solaris/Linux (X_PLATFORM != X_WINDOWS)
  82 */
  83 #if (X_PLATFORM != X_WINDOWS)
  84 
  85 typedef unsigned char           UINT8;
  86 typedef char                    INT8;
  87 typedef short                   INT16;
  88 typedef unsigned short          UINT16;
  89 #ifdef _LP64
  90 typedef int                     INT32;
  91 typedef unsigned int            UINT32;
  92 typedef unsigned long           UINT64;
  93 typedef long                    INT64;
  94 #else /* _LP64 */
  95 typedef long                    INT32;
  96 typedef unsigned long           UINT32;
  97 /* generic 64 bit ? */
  98 typedef unsigned long long      UINT64;
  99 typedef long long               INT64;
 100 #endif /* _LP64 */
 101 
 102 typedef unsigned long           UINT_PTR;
 103 typedef long                    INT_PTR;
 104 
 105 #endif /* X_PLATFORM != X_WINDOWS */
 106 
 107 
 108 typedef unsigned char   UBYTE;
 109 typedef char            SBYTE;
 110 
 111 
 112 #undef TRUE
 113 #undef FALSE
 114 
 115 #ifndef TRUE
 116 #define TRUE    1
 117 #endif
 118 
 119 #ifndef FALSE
 120 #define FALSE   0
 121 #endif
 122 
 123 #undef NULL
 124 #ifndef NULL
 125 #define NULL    0L
 126 #endif
 127 
 128 
 129 
 130 
 131 #if X_PLATFORM == X_WINDOWS
 132 #include <stdlib.h>
 133 #define INLINE          _inline
 134 #endif
 135 
 136 
 137 #if X_PLATFORM == X_SOLARIS
 138 #define INLINE
 139 #endif
 140 
 141 
 142 #if X_PLATFORM == X_LINUX
 143 #define INLINE          inline
 144 #endif
 145 
 146 
 147 #if (X_PLATFORM == X_BSD) || (X_PLATFORM == X_MACOSX)
 148 #define INLINE          inline
 149 #endif
 150 
 151 
 152 #endif  // __SOUNDDEFS_INCLUDED__