mirror of
https://github.com/phoboslab/wipeout-rewrite
synced 2024-12-26 09:59:04 +01:00
Fix building on Windows
- Drop linking opengl32/glew32.libs using `#pragma`s in favour of specifing the libraries at build time. - Use check for the `WIN32` macro when including Windows specific headers in `src/render_gl.c`. - Undefine the `min`, `max`, `near`, and `far` macros when building on Windows.
This commit is contained in:
parent
ecf1e63508
commit
9207839c80
2 changed files with 11 additions and 9 deletions
|
@ -11,18 +11,14 @@
|
|||
// Linux
|
||||
#elif defined(__unix__)
|
||||
#include <GL/glew.h>
|
||||
#elif defined(__MSYS__)
|
||||
#include <GL/glew.h>
|
||||
// WINDOWS
|
||||
#else
|
||||
|
||||
// Windows
|
||||
#elif defined(WIN32)
|
||||
#include <windows.h>
|
||||
|
||||
#define GL3_PROTOTYPES 1
|
||||
#include <glew.h>
|
||||
#pragma comment(lib, "glew32.lib")
|
||||
|
||||
#include <gl/GL.h>
|
||||
#pragma comment(lib, "opengl32.lib")
|
||||
#include <GL/glew.h>
|
||||
#include <GL/gl.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
#include <string.h>
|
||||
#include "types.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#undef min
|
||||
#undef max
|
||||
#undef near
|
||||
#undef far
|
||||
#endif
|
||||
|
||||
#if !defined(offsetof)
|
||||
#define offsetof(TYPE, ELEMENT) ((size_t)&(((TYPE *)0)->ELEMENT))
|
||||
|
|
Loading…
Reference in a new issue