Test: Fix OS/2 compilation in math suite.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
diff --git a/test/testautomation_math.c b/test/testautomation_math.c
index e6ec303..595ed67 100644
--- a/test/testautomation_math.c
+++ b/test/testautomation_math.c
@@ -35,6 +35,15 @@ typedef struct
/* ================= Test Helpers ================== */
+/* OS/2 uses different function signatures for the helpers */
+#ifdef __OS2__
+typedef double(_Syscall *d_to_d_func)(double);
+typedef double(_Syscall *dd_to_d_func)(double, double);
+#else
+typedef double (*d_to_d_func)(double);
+typedef double (*dd_to_d_func)(double, double);
+#endif
+
/**
* \brief Runs all the cases on a given function with a signature double -> double
*
@@ -44,7 +53,7 @@ typedef struct
* \param cases_size, the size of the cases array.
*/
static int
-helper_dtod(const char *func_name, double (*func)(double),
+helper_dtod(const char *func_name, d_to_d_func func,
const d_to_d *cases, const size_t cases_size)
{
Uint32 i;
@@ -69,7 +78,7 @@ helper_dtod(const char *func_name, double (*func)(double),
* \param cases_size, the size of the cases array.
*/
static int
-helper_ddtod(const char *func_name, double (*func)(double, double),
+helper_ddtod(const char *func_name, dd_to_d_func func,
const dd_to_d *cases, const size_t cases_size)
{
Uint32 i;
@@ -95,7 +104,7 @@ helper_ddtod(const char *func_name, double (*func)(double, double),
* \param func, the function to call.
*/
static int
-helper_range(const char *func_name, double (*func)(double))
+helper_range(const char *func_name, d_to_d_func func)
{
const Uint32 ITERATIONS = 10000000;
const Uint32 STEP = SDL_MAX_UINT32 / ITERATIONS;