aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/include/AL/al.h172
-rw-r--r--system/include/AL/alc.h84
-rw-r--r--system/include/libc/ctype.h23
-rw-r--r--system/include/libc/math.h27
4 files changed, 284 insertions, 22 deletions
diff --git a/system/include/AL/al.h b/system/include/AL/al.h
new file mode 100644
index 00000000..d7234e32
--- /dev/null
+++ b/system/include/AL/al.h
@@ -0,0 +1,172 @@
+#ifndef OPENAL_AL_H__
+#define OPENAL_AL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AL_BITS 0x2002
+#define AL_BUFFER 0x1009
+#define AL_BUFFERS_PROCESSED 0x1016
+#define AL_BUFFERS_QUEUED 0x1015
+#define AL_BYTE_OFFSET 0x1026
+#define AL_CHANNELS 0x2003
+#define AL_CONE_INNER_ANGLE 0x1001
+#define AL_CONE_OUTER_ANGLE 0x1002
+#define AL_CONE_OUTER_GAIN 0x1022
+#define AL_DIRECTION 0x1005
+#define AL_DISTANCE_MODEL 0xD000
+#define AL_DOPPLER_FACTOR 0xC000
+#define AL_DOPPLER_VELOCITY 0xC001
+#define AL_EXPONENT_DISTANCE 0xD005
+#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
+#define AL_EXTENSIONS 0xB004
+#define AL_FALSE 0
+#define AL_FORMAT_MONO16 0x1101
+#define AL_FORMAT_MONO8 0x1100
+#define AL_FORMAT_STEREO16 0x1103
+#define AL_FORMAT_STEREO8 0x1102
+#define AL_FREQUENCY 0x2001
+#define AL_GAIN 0x100A
+#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
+#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
+#define AL_INITIAL 0x1011
+#define AL_INVALID (-1)
+#define AL_INVALID_ENUM 0xA002
+#define AL_INVALID_NAME 0xA001
+#define AL_INVALID_OPERATION 0xA004
+#define AL_INVALID_VALUE 0xA003
+#define AL_INVERSE_DISTANCE 0xD001
+#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
+#define AL_LINEAR_DISTANCE 0xD003
+#define AL_LINEAR_DISTANCE_CLAMPED 0xD004
+#define AL_LOOPING 0x1007
+#define AL_MAX_DISTANCE 0x1023
+#define AL_MAX_GAIN 0x100E
+#define AL_MIN_GAIN 0x100D
+#define AL_NONE 0
+#define AL_NO_ERROR 0
+#define AL_ORIENTATION 0x100F
+#define AL_OUT_OF_MEMORY 0xA005
+#define AL_PAUSED 0x1013
+#define AL_PENDING 0x2011
+#define AL_PITCH 0x1003
+#define AL_PLAYING 0x1012
+#define AL_POSITION 0x1004
+#define AL_PROCESSED 0x2012
+#define AL_REFERENCE_DISTANCE 0x1020
+#define AL_RENDERER 0xB003
+#define AL_ROLLOFF_FACTOR 0x1021
+#define AL_SAMPLE_OFFSET 0x1025
+#define AL_SEC_OFFSET 0x1024
+#define AL_SIZE 0x2004
+#define AL_SOURCE_RELATIVE 0x202
+#define AL_SOURCE_STATE 0x1010
+#define AL_SOURCE_TYPE 0x1027
+#define AL_SPEED_OF_SOUND 0xC003
+#define AL_STATIC 0x1028
+#define AL_STOPPED 0x1014
+#define AL_STREAMING 0x1029
+#define AL_TRUE 1
+#define AL_UNDETERMINED 0x1030
+#define AL_UNUSED 0x2010
+#define AL_VELOCITY 0x1006
+#define AL_VENDOR 0xB001
+#define AL_VERSION 0xB002
+#define AL_VERSION_1_0
+#define AL_VERSION_1_1
+#define OPENAL
+
+typedef char ALboolean;
+typedef char ALchar;
+typedef double ALdouble;
+typedef float ALfloat;
+typedef int ALenum;
+typedef int ALint;
+typedef int ALsizei;
+typedef short ALshort;
+typedef signed char ALbyte;
+typedef unsigned char ALubyte;
+typedef unsigned int ALuint;
+typedef unsigned short ALushort;
+typedef void ALvoid;
+
+extern ALboolean alGetBoolean(ALenum param);
+extern ALboolean alIsBuffer(ALuint buffer);
+extern ALboolean alIsEnabled(ALenum capability);
+extern ALboolean alIsExtensionPresent(const ALchar *extname);
+extern ALboolean alIsSource(ALuint source);
+extern ALdouble alGetDouble(ALenum param);
+extern ALenum alGetEnumValue(const ALchar *ename);
+extern ALenum alGetError();
+extern ALfloat alGetFloat(ALenum param);
+extern ALint alGetInteger(ALenum param);
+extern const ALchar *alGetString(ALenum param);
+extern void *alGetProcAddress(const ALchar *fname);
+extern void alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
+extern void alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
+extern void alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
+extern void alBufferf(ALuint buffer, ALenum param, ALfloat value);
+extern void alBufferfv(ALuint buffer, ALenum param, const ALfloat *values);
+extern void alBufferi(ALuint buffer, ALenum param, ALint value);
+extern void alBufferiv(ALuint buffer, ALenum param, const ALint *values);
+extern void alDeleteBuffers(ALsizei n, const ALuint *buffers);
+extern void alDeleteSources(ALsizei n, const ALuint *sources);
+extern void alDisable(ALenum capability);
+extern void alDistanceModel(ALenum distanceModel);
+extern void alDopplerFactor(ALfloat value);
+extern void alDopplerVelocity(ALfloat value);
+extern void alEnable(ALenum capability);
+extern void alGenBuffers(ALsizei n, ALuint *buffers);
+extern void alGenSources(ALsizei n, ALuint *sources);
+extern void alGetBooleanv(ALenum param, ALboolean *values);
+extern void alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
+extern void alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
+extern void alGetBufferf(ALuint buffer, ALenum param, ALfloat *value);
+extern void alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values);
+extern void alGetBufferi(ALuint buffer, ALenum param, ALint *value);
+extern void alGetBufferiv(ALuint buffer, ALenum param, ALint *values);
+extern void alGetDoublev(ALenum param, ALdouble *values);
+extern void alGetFloatv(ALenum param, ALfloat *values);
+extern void alGetIntegerv(ALenum param, ALint *values);
+extern void alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
+extern void alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3);
+extern void alGetListenerf(ALenum param, ALfloat *value);
+extern void alGetListenerfv(ALenum param, ALfloat *values);
+extern void alGetListeneri(ALenum param, ALint *value);
+extern void alGetListeneriv(ALenum param, ALint *values);
+extern void alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
+extern void alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
+extern void alGetSourcef(ALuint source, ALenum param, ALfloat *value);
+extern void alGetSourcefv(ALuint source, ALenum param, ALfloat *values);
+extern void alGetSourcei(ALuint source, ALenum param, ALint *value);
+extern void alGetSourceiv(ALuint source, ALenum param, ALint *values);
+extern void alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
+extern void alListener3i(ALenum param, ALint value1, ALint value2, ALint value3);
+extern void alListenerf(ALenum param, ALfloat value);
+extern void alListenerfv(ALenum param, const ALfloat *values);
+extern void alListeneri(ALenum param, ALint value);
+extern void alListeneriv(ALenum param, const ALint *values);
+extern void alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
+extern void alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
+extern void alSourcePause(ALuint source);
+extern void alSourcePausev(ALsizei n, const ALuint *sources);
+extern void alSourcePlay(ALuint source);
+extern void alSourcePlayv(ALsizei n, const ALuint *sources);
+extern void alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers);
+extern void alSourceRewind(ALuint source);
+extern void alSourceRewindv(ALsizei n, const ALuint *sources);
+extern void alSourceStop(ALuint source);
+extern void alSourceStopv(ALsizei n, const ALuint *sources);
+extern void alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers);
+extern void alSourcef(ALuint source, ALenum param, ALfloat value);
+extern void alSourcefv(ALuint source, ALenum param, const ALfloat *values);
+extern void alSourcei(ALuint source, ALenum param, ALint value);
+extern void alSourceiv(ALuint source, ALenum param, const ALint *values);
+extern void alSpeedOfSound(ALfloat value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/system/include/AL/alc.h b/system/include/AL/alc.h
new file mode 100644
index 00000000..6ff7cb9b
--- /dev/null
+++ b/system/include/AL/alc.h
@@ -0,0 +1,84 @@
+#ifndef OPENAL_ALC_H__
+#define OPENAL_ALC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ALCAPI ALC_API
+#define ALCAPIENTRY ALC_APIENTRY
+#define ALC_ALL_ATTRIBUTES 0x1003
+#define ALC_ALL_DEVICES_SPECIFIER 0x1013
+#define ALC_ATTRIBUTES_SIZE 0x1002
+#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
+#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
+#define ALC_CAPTURE_SAMPLES 0x312
+#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
+#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
+#define ALC_DEVICE_SPECIFIER 0x1005
+#define ALC_ENUMERATE_ALL_EXT 1
+#define ALC_EXTENSIONS 0x1006
+#define ALC_EXT_CAPTURE 1
+#define ALC_FALSE 0
+#define ALC_FREQUENCY 0x1007
+#define ALC_INVALID 0
+#define ALC_INVALID_CONTEXT 0xA002
+#define ALC_INVALID_DEVICE 0xA001
+#define ALC_INVALID_ENUM 0xA003
+#define ALC_INVALID_VALUE 0xA004
+#define ALC_MAJOR_VERSION 0x1000
+#define ALC_MINOR_VERSION 0x1001
+#define ALC_MONO_SOURCES 0x1010
+#define ALC_NO_ERROR 0
+#define ALC_OUT_OF_MEMORY 0xA005
+#define ALC_REFRESH 0x1008
+#define ALC_STEREO_SOURCES 0x1011
+#define ALC_SYNC 0x1009
+#define ALC_TRUE 1
+#define ALC_VERSION_0_1 1
+#define AL_ALC_H
+
+struct ALCcontext_struct;
+struct ALCdevice_struct;
+typedef char ALCboolean;
+typedef char ALCchar;
+typedef double ALCdouble;
+typedef float ALCfloat;
+typedef int ALCenum;
+typedef int ALCint;
+typedef int ALCsizei;
+typedef short ALCshort;
+typedef signed char ALCbyte;
+typedef struct ALCcontext_struct ALCcontext;
+typedef struct ALCdevice_struct ALCdevice;
+typedef unsigned char ALCubyte;
+typedef unsigned int ALCuint;
+typedef unsigned short ALCushort;
+typedef void ALCvoid;
+
+extern ALCboolean alcCaptureCloseDevice(ALCdevice *device);
+extern ALCboolean alcCloseDevice(ALCdevice *device);
+extern ALCboolean alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
+extern ALCboolean alcMakeContextCurrent(ALCcontext *context);
+extern ALCcontext *alcCreateContext(ALCdevice *device, const ALCint *attrlist);
+extern ALCcontext *alcGetCurrentContext();
+extern ALCdevice *alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
+extern ALCdevice *alcGetContextsDevice(ALCcontext *context);
+extern ALCdevice *alcOpenDevice(const ALCchar *devicename);
+extern ALCenum alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
+extern ALCenum alcGetError(ALCdevice *device);
+extern const ALCchar *alcGetString(ALCdevice *device, ALCenum param);
+extern void *alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
+extern void alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
+extern void alcCaptureStart(ALCdevice *device);
+extern void alcCaptureStop(ALCdevice *device);
+extern void alcDestroyContext(ALCcontext *context);
+extern void alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
+extern void alcProcessContext(ALCcontext *context);
+extern void alcSuspendContext(ALCcontext *context);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/system/include/libc/ctype.h b/system/include/libc/ctype.h
index 26d3c6ce..383a8db1 100644
--- a/system/include/libc/ctype.h
+++ b/system/include/libc/ctype.h
@@ -72,11 +72,14 @@ _CONST
#define isgraph(__c) (__ctype_lookup(__c)&(CTYPE__P|CTYPE__U|CTYPE__L|CTYPE__N))
#define iscntrl(__c) (__ctype_lookup(__c)&CTYPE__C)
+/* XXX: EMSCRIPTEN: We alter the names of __typeof__ declarations to
+ reduce the chance of them conflicting when expanded */
+
#if defined(__GNUC__) && \
(!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L)
#define isblank(__c) \
- __extension__ ({ __typeof__ (__c) __x = (__c); \
- (__ctype_lookup(__x)&_B) || (int) (__x) == '\t';})
+ __extension__ ({ __typeof__ (__c) __ctb_x = (__c); \
+ (__ctype_lookup(__ctb_x)&_B) || (int) (__ctb_x) == '\t';})
#endif
@@ -86,20 +89,20 @@ _CONST
# if defined(__GNUC__)
# if !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS)
# define toupper(__c) \
- __extension__ ({ __typeof__ (__c) __x = (__c); \
- islower (__x) ? (int) __x - 'a' + 'A' : (int) __x;})
+ __extension__ ({ __typeof__ (__c) __cttu_x = (__c); \
+ islower (__cttu_x) ? (int) __cttu_x - 'a' + 'A' : (int) __cttu_x;})
# define tolower(__c) \
- __extension__ ({ __typeof__ (__c) __x = (__c); \
- isupper (__x) ? (int) __x - 'A' + 'a' : (int) __x;})
+ __extension__ ({ __typeof__ (__c) __cttl_x = (__c); \
+ isupper (__cttl_x) ? (int) __cttl_x - 'A' + 'a' : (int) __cttl_x;})
# else /* _MB_EXTENDED_CHARSETS* */
/* Allow a gcc warning if the user passed 'char', but defer to the
function. */
# define toupper(__c) \
- __extension__ ({ __typeof__ (__c) __x = (__c); \
- (void) __ctype_ptr__[__x]; (toupper) (__x);})
+ __extension__ ({ __typeof__ (__c) __cttu_x = (__c); \
+ (void) __ctype_ptr__[__cttu_x]; (toupper) (__cttu_x);})
# define tolower(__c) \
- __extension__ ({ __typeof__ (__c) __x = (__c); \
- (void) __ctype_ptr__[__x]; (tolower) (__x);})
+ __extension__ ({ __typeof__ (__c) __cttl_x = (__c); \
+ (void) __ctype_ptr__[__cttl_x]; (tolower) (__cttl_x);})
# endif /* _MB_EXTENDED_CHARSETS* */
# endif /* __GNUC__ */
#endif /* !__cplusplus */
diff --git a/system/include/libc/math.h b/system/include/libc/math.h
index d963c6c8..e2f8cdef 100644
--- a/system/include/libc/math.h
+++ b/system/include/libc/math.h
@@ -210,25 +210,28 @@ extern int __signbitd (double x);
((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \
__signbitd(__x))
+/* XXX: EMSCRIPTEN: We alter the names of __typeof__ declarations to
+ reduce the chance of them conflicting when expanded */
+
#define isgreater(x,y) \
- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered(__x,__y) && (__x > __y);}))
+ (__extension__ ({__typeof__(x) __isg_x = (x); __typeof__(y) __isg_y = (y); \
+ !isunordered(__isg_x,__isg_y) && (__isg_x > __isg_y);}))
#define isgreaterequal(x,y) \
- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered(__x,__y) && (__x >= __y);}))
+ (__extension__ ({__typeof__(x) __isge_x = (x); __typeof__(y) __isge_y = (y); \
+ !isunordered(__isge_x,__isge_y) && (__isge_x >= __isge_y);}))
#define isless(x,y) \
- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered(__x,__y) && (__x < __y);}))
+ (__extension__ ({__typeof__(x) __isl_x = (x); __typeof__(y) __isl_y = (y); \
+ !isunordered(__isl_x,__isl_y) && (__isl_x < __isl_y);}))
#define islessequal(x,y) \
- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered(__x,__y) && (__x <= __y);}))
+ (__extension__ ({__typeof__(x) __isle_x = (x); __typeof__(y) __isle_y = (y); \
+ !isunordered(__isle_x,__isle_y) && (__isle_x <= __isle_y);}))
#define islessgreater(x,y) \
- (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
- !isunordered(__x,__y) && (__x < __y || __x > __y);}))
+ (__extension__ ({__typeof__(x) __islg_x = (x); __typeof__(y) __islg_y = (y); \
+ !isunordered(__islg_x,__islg_y) && (__islg_x < __islg_y || __islg_x > __islg_y);}))
#define isunordered(a,b) \
- (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \
- fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;}))
+ (__extension__ ({__typeof__(a) __isu_a = (a); __typeof__(b) __isu_b = (b); \
+ fpclassify(__isu_a) == FP_NAN || fpclassify(__isu_b) == FP_NAN;}))
/* Non ANSI double precision functions. */