diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-15 18:21:34 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-15 18:21:34 -0700 |
commit | b22f6fbbbebb5df55ceb8fdc9f7c4d111c902c5e (patch) | |
tree | c568136b2cf95d897d128b362720602a3b401244 /system/include | |
parent | 8c9a37a40a164dba330390af2eabf5ad05625001 (diff) | |
parent | 27d1a249622d33ab8aff2814d13569507336873b (diff) |
Merge branch 'incoming'
Diffstat (limited to 'system/include')
-rw-r--r-- | system/include/AL/al.h | 172 | ||||
-rw-r--r-- | system/include/AL/alc.h | 84 | ||||
-rw-r--r-- | system/include/emscripten/emscripten.h | 4 | ||||
-rw-r--r-- | system/include/err.h | 95 | ||||
-rw-r--r-- | system/include/libc/ctype.h | 23 | ||||
-rw-r--r-- | system/include/libc/iso646.h | 43 | ||||
-rw-r--r-- | system/include/libc/math.h | 27 | ||||
-rw-r--r-- | system/include/stdbool.h | 3 |
8 files changed, 426 insertions, 25 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/emscripten/emscripten.h b/system/include/emscripten/emscripten.h index 427dda0c..61634b0e 100644 --- a/system/include/emscripten/emscripten.h +++ b/system/include/emscripten/emscripten.h @@ -60,7 +60,7 @@ extern void emscripten_async_run_script(const char *script, int millis); * that execution continues normally. Note that in both cases * we do not run global destructors, atexit, etc., since we * know the main loop will still be running, but if we do - * not simulate an infinite loop then the stack will be unwinded. + * not simulate an infinite loop then the stack will be unwound. * That means that if simulate_infinite_loop is false, and * you created an object on the stack, it will be cleaned up * before the main loop will be called the first time. @@ -215,7 +215,7 @@ void emscripten_async_wget_data(const char* url, void *arg, void (*onload)(void* * More feature-complete version of emscripten_async_wget. Note: * this version is experimental. * - * The requestype is 'GET' or 'POST', + * The requesttype is 'GET' or 'POST', * If is post request, param is the post parameter * like key=value&key2=value2. * The param 'arg' is a pointer will be pass to the callback diff --git a/system/include/err.h b/system/include/err.h new file mode 100644 index 00000000..a9b92ee6 --- /dev/null +++ b/system/include/err.h @@ -0,0 +1,95 @@ +/* $OpenBSD: err.h,v 1.10 2006/01/06 18:53:04 millert Exp $ */ +/* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)err.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _ERR_H_ +#define _ERR_H_ + +/* + * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two + * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one + * of them here we may collide with the utility's includes. It's unreasonable + * for utilities to have to include one of them to include err.h, so we get + * va_list from <machine/_types.h> and use it. + */ +#include <sys/cdefs.h> +//#include <machine/_types.h> +#include <stdarg.h> + +#define __dead __attribute__((__noreturn__)) + +__BEGIN_DECLS + +__dead void err(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__dead void verr(int, const char *, va_list) + __attribute__((__format__ (printf, 2, 0))); +__dead void errx(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__dead void verrx(int, const char *, va_list) + __attribute__((__format__ (printf, 2, 0))); +void warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void vwarn(const char *, va_list) + __attribute__((__format__ (printf, 1, 0))); +void warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void vwarnx(const char *, va_list) + __attribute__((__format__ (printf, 1, 0))); + +/* + * The _* versions are for use in library functions so user-defined + * versions of err*,warn* do not get used. + */ +__dead void _err(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__dead void _verr(int, const char *, va_list) + __attribute__((__format__ (printf, 2, 0))); +__dead void _errx(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__dead void _verrx(int, const char *, va_list) + __attribute__((__format__ (printf, 2, 0))); +void _warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void _vwarn(const char *, va_list) + __attribute__((__format__ (printf, 1, 0))); +void _warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void _vwarnx(const char *, va_list) + __attribute__((__format__ (printf, 1, 0))); + +#undef __dead + +__END_DECLS + +#endif /* !_ERR_H_ */ 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/iso646.h b/system/include/libc/iso646.h new file mode 100644 index 00000000..dca13c5b --- /dev/null +++ b/system/include/libc/iso646.h @@ -0,0 +1,43 @@ +/*===---- iso646.h - Standard header for alternate spellings of operators---=== + * + * Copyright (c) 2008 Eli Friedman + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + *===-----------------------------------------------------------------------=== + */ + +#ifndef __ISO646_H +#define __ISO646_H + +#ifndef __cplusplus +#define and && +#define and_eq &= +#define bitand & +#define bitor | +#define compl ~ +#define not ! +#define not_eq != +#define or || +#define or_eq |= +#define xor ^ +#define xor_eq ^= +#endif + +#endif /* __ISO646_H */ 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. */ diff --git a/system/include/stdbool.h b/system/include/stdbool.h index f970ade8..561eed3f 100644 --- a/system/include/stdbool.h +++ b/system/include/stdbool.h @@ -2,12 +2,13 @@ #ifndef __stdbool_h__ #define __stdbool_h__ +#define __bool_true_false_are_defined 1 + #ifndef __cplusplus #define bool _Bool #define true 1 #define false 0 -#define __bool_true_false_are_defined 1 #endif |