From 55b8dece8497ede6f7c58267979e8f025367f54d Mon Sep 17 00:00:00 2001
From: Sam Hocevar <sam@hocevar.net>
Date: Sun, 6 Nov 2011 01:07:47 +0000
Subject: [PATCH] test: fix OS X compilation; we still need SDLmain.a on that
 platform.

---
 src/video.cpp           | 2 +-
 test/math/pi.cpp        | 4 ++++
 test/math/poly.cpp      | 6 +++++-
 test/math/remez.cpp     | 6 +++++-
 test/tutorial/tut01.cpp | 2 +-
 test/tutorial/tut02.cpp | 2 +-
 test/xolotl/xolotl.cpp  | 2 +-
 7 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/video.cpp b/src/video.cpp
index 102e1372..b7133861 100644
--- a/src/video.cpp
+++ b/src/video.cpp
@@ -44,7 +44,7 @@ mat4 VideoData::proj_matrix;
 mat4 VideoData::view_matrix;
 
 #if defined __ANDROID__ || defined __CELLOS_LV2__ || defined __APPLE__
-ivec2 VideoData::saved_viewport = 0;
+ivec2 VideoData::saved_viewport(0, 0);
 #endif
 
 /*
diff --git a/test/math/pi.cpp b/test/math/pi.cpp
index 664c6022..ca457566 100644
--- a/test/math/pi.cpp
+++ b/test/math/pi.cpp
@@ -14,6 +14,10 @@
 
 #include <cstdio>
 
+#if USE_SDL && defined __APPLE__
+#   include <SDL_main.h>
+#endif
+
 #include "core.h"
 
 using namespace lol;
diff --git a/test/math/poly.cpp b/test/math/poly.cpp
index 9ca7d6b2..724bd57d 100644
--- a/test/math/poly.cpp
+++ b/test/math/poly.cpp
@@ -14,6 +14,10 @@
 
 #include <cstdio>
 
+#if USE_SDL && defined __APPLE__
+#   include <SDL_main.h>
+#endif
+
 #include "core.h"
 
 using namespace lol;
@@ -95,7 +99,7 @@ static float floatsin(float f)
 #undef float
 }
 
-int main(void)
+int main(int argc, char **argv)
 {
     typedef union { float f; uint32_t x; } flint;
 
diff --git a/test/math/remez.cpp b/test/math/remez.cpp
index 59750a11..f582245d 100644
--- a/test/math/remez.cpp
+++ b/test/math/remez.cpp
@@ -15,6 +15,10 @@
 #include <cstring>
 #include <cstdio>
 
+#if USE_SDL && defined __APPLE__
+#   include <SDL_main.h>
+#endif
+
 #include "core.h"
 
 using namespace lol;
@@ -36,7 +40,7 @@ real myerr(real const &y)
     return sin(x) / (x * y);
 }
 
-int main(void)
+int main(int argc, char **argv)
 {
     RemezSolver<6> solver;
     solver.Run(real::R_1 >> 400, real::R_PI_2 * real::R_PI_2, myfun, myerr, 40);
diff --git a/test/tutorial/tut01.cpp b/test/tutorial/tut01.cpp
index aff014e7..4eadd70d 100644
--- a/test/tutorial/tut01.cpp
+++ b/test/tutorial/tut01.cpp
@@ -110,7 +110,7 @@ private:
     bool m_ready;
 };
 
-int main()
+int main(int argc, char **argv)
 {
     Application app("Tutorial 1: Triangle", ivec2(640, 480), 60.0f);
 
diff --git a/test/tutorial/tut02.cpp b/test/tutorial/tut02.cpp
index 02c98928..c08d1604 100644
--- a/test/tutorial/tut02.cpp
+++ b/test/tutorial/tut02.cpp
@@ -173,7 +173,7 @@ private:
     bool m_ready;
 };
 
-int main()
+int main(int argc, char **argv)
 {
     Application app("Tutorial 2: Cube", ivec2(640, 480), 60.0f);
 
diff --git a/test/xolotl/xolotl.cpp b/test/xolotl/xolotl.cpp
index c486fb7e..21dc092d 100644
--- a/test/xolotl/xolotl.cpp
+++ b/test/xolotl/xolotl.cpp
@@ -63,7 +63,7 @@ private:
     vec2 graph[2000];
 };
 
-int main()
+int main(int argc, char **argv)
 {
     Application app("Xolotl", ivec2(640, 480), 60.0f);