1 /*
   2  * Copyright (c) 2007, 2015, 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_LINUX         2
  33 #define X_BSD           3
  34 #define X_MACOSX        4
  35 
  36 // **********************************
  37 // Make sure you set X_PLATFORM defines correctly.
  38 // Everything depends upon this flag being setup correctly.
  39 // **********************************
  40 
  41 #if (!defined(X_PLATFORM))
  42 #error "You need to define X_PLATFORM outside of the source. Use the types above."
  43 #endif
  44 
  45 
  46 // following is needed for _LP64
  47 #if ((X_PLATFORM == X_LINUX) || (X_PLATFORM == X_MACOSX))
  48 #include <sys/types.h>
  49 #endif
  50 
  51 #if X_PLATFORM == X_WINDOWS
  52 #ifndef WIN32_LEAN_AND_MEAN
  53 #define WIN32_LEAN_AND_MEAN
  54 #endif
  55 #include <windows.h>
  56 #endif /* X_PLATFORM == X_WINDOWS */
  57 
  58 
  59 /*
  60 * These types are defined elsewhere for newer 32/64-bit Windows
  61 * header files, but not on Solaris/Linux (X_PLATFORM != X_WINDOWS)
  62 */
  63 #if (X_PLATFORM != X_WINDOWS)
  64 
  65 typedef unsigned char           UINT8;
  66 typedef char                    INT8;
  67 typedef short                   INT16;
  68 typedef unsigned short          UINT16;
  69 #ifdef _LP64
  70 typedef int                     INT32;
  71 typedef unsigned int            UINT32;
  72 typedef unsigned long           UINT64;
  73 typedef long                    INT64;
  74 #else /* _LP64 */
  75 typedef long                    INT32;
  76 typedef unsigned long           UINT32;
  77 /* generic 64 bit ? */
  78 typedef unsigned long long      UINT64;
  79 typedef long long               INT64;
  80 #endif /* _LP64 */
  81 
  82 typedef unsigned long           UINT_PTR;
  83 typedef long                    INT_PTR;
  84 
  85 #endif /* X_PLATFORM != X_WINDOWS */
  86 
  87 
  88 typedef unsigned char   UBYTE;
  89 typedef char            SBYTE;
  90 
  91 
  92 #undef TRUE
  93 #undef FALSE
  94 
  95 #ifndef TRUE
  96 #define TRUE    1
  97 #endif
  98 
  99 #ifndef FALSE
 100 #define FALSE   0
 101 #endif
 102 
 103 #undef NULL
 104 #ifndef NULL
 105 #define NULL    0L
 106 #endif
 107 
 108 
 109 
 110 
 111 #if X_PLATFORM == X_WINDOWS
 112 #include <stdlib.h>
 113 #define INLINE          _inline
 114 #endif
 115 
 116 
 117 #if X_PLATFORM == X_LINUX
 118 #define INLINE          inline
 119 #endif
 120 
 121 
 122 #if (X_PLATFORM == X_BSD) || (X_PLATFORM == X_MACOSX)
 123 #define INLINE          inline
 124 #endif
 125 
 126 
 127 #endif  // __SOUNDDEFS_INCLUDED__