clean up windowshacks.h

This commit is contained in:
Brad Hefta-Gaub 2014-01-13 01:09:29 -08:00
parent 9441f9ffb7
commit 98efbade9b

View file

@ -12,26 +12,14 @@
#define __hifi__windowshacks__ #define __hifi__windowshacks__
#ifdef WIN32 #ifdef WIN32
#undef NOMINMAX #undef NOMINMAX
#define GLdouble GLdouble
#define GL_DOUBLE 0x140A
#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
#define GL_RESCALE_NORMAL 0x803A
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
#define GL_CLAMP_TO_BORDER 0x812D
#include <cmath> #include <cmath>
inline double roundf(double value) { inline double roundf(double value) {
return (value > 0.0) ? floor(value + 0.5) : ceil(value - 0.5); return (value > 0.0) ? floor(value + 0.5) : ceil(value - 0.5);
} }
#define round roundf #define round roundf
#ifdef _MSC_VER #ifdef _MSC_VER
#ifndef SNPRINTF_FIX #ifndef SNPRINTF_FIX
#define SNPRINTF_FIX #define SNPRINTF_FIX
@ -40,20 +28,18 @@ inline double roundf(double value) {
#define snprintf c99_snprintf #define snprintf c99_snprintf
inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) inline int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap) {
{
int count = -1; int count = -1;
if (size != 0) {
if (size != 0)
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap); count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
if (count == -1) }
if (count == -1) {
count = _vscprintf(format, ap); count = _vscprintf(format, ap);
}
return count; return count;
} }
inline int c99_snprintf(char* str, size_t size, const char* format, ...) inline int c99_snprintf(char* str, size_t size, const char* format, ...) {
{
int count; int count;
va_list ap; va_list ap;
@ -64,11 +50,16 @@ inline int c99_snprintf(char* str, size_t size, const char* format, ...)
return count; return count;
} }
#endif // SNPRINTF_FIX #endif // SNPRINTF_FIX
#endif // _MSC_VER #endif // _MSC_VER
// OpenGL related hacks, this is temporary
#define GLdouble GLdouble
#define GL_DOUBLE 0x140A
#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
#define GL_RESCALE_NORMAL 0x803A
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
#define GL_CLAMP_TO_BORDER 0x812D
#endif // WIN32 #endif // WIN32
#endif // __hifi__windowshacks__ #endif // __hifi__windowshacks__