From c392bbca881063c5dc27f46f247f78605f511e08 Mon Sep 17 00:00:00 2001 From: "Eric J. Korpela" Date: Tue, 2 Sep 2003 23:26:38 +0000 Subject: [PATCH] Mods for getting SETI@home working under windows svn path=/trunk/boinc/; revision=2221 --- api/gutil.C | 45 ++++++++++++++++++++++++++++++++++++--------- lib/std_fixes.h | 23 ++++++++++++++++++++++- lib/util.h | 3 ++- 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/api/gutil.C b/api/gutil.C index 35e394f796..c127965349 100755 --- a/api/gutil.C +++ b/api/gutil.C @@ -17,25 +17,52 @@ // Contributor(s): // +#include "config.h" + #include #include #include #include #ifdef _WIN32 #include -#include -#include -#include #endif -#ifdef __APPLE_CC__ + +#ifdef HAVE_GL_H +#include "gl.h" +#elif defined(HAVE_GL_GL_H) +#include +#elif defined(HAVE_OPENGL_GL_H) #include +#endif + +#ifdef HAVE_GLU_H +#include "glu.h" +#elif defined(HAVE_GL_GLU_H) +#include +#elif defined(HAVE_OPENGL_GLU_H) +#include +#endif + +#ifdef HAVE_GLUT_H +#include "glut.h" +#elif defined(HAVE_GL_GLUT_H) +#include +#elif defined(HAVE_OPENGL_GLUT_H) +#include +#elif defined(HAVE_GLUT_GLUT_H) #include #endif -#ifdef unix -#include -#include -#include -#endif + +// the old way +// #ifdef __APPLE_CC__ +// #include +// #include +// #endif +// #ifdef unix +// #include +// #include +// #include +// #endif #include "gutil.h" GLfloat mat_diffuse[] = {0.7, 0.5, 1.0, 0.4}; diff --git a/lib/std_fixes.h b/lib/std_fixes.h index 0a20a7a76f..58f6879d1d 100644 --- a/lib/std_fixes.h +++ b/lib/std_fixes.h @@ -15,7 +15,7 @@ inline T min(const T &a, const T &b) { } #endif -#ifndef HAVE_STD_MIN +#ifndef HAVE_STD_MAX namespace std { #ifdef max #undef max @@ -29,5 +29,26 @@ inline T max(const T &a, const T &b) { } #endif +#ifndef HAVE_STD_TRANSFORM +#include +#include + +namespace std { +#ifdef transform +#undef transform #endif + +template +o_iterator transform(i_iterator first, i_iterator last, o_iterator res, OP op) { + for (;first != last; first++) { + *(res++)=op(*first); + } + return (res); +} + +} + +#endif + +#endif \ No newline at end of file diff --git a/lib/util.h b/lib/util.h index 2977f30444..8ee30af63b 100755 --- a/lib/util.h +++ b/lib/util.h @@ -27,8 +27,9 @@ #include #include #include -#include #include +#include + using std::string; extern int double_to_ydhms (double x, int smallest_timescale, char *buf);