sdl2.m4 updates: - remove HP/UX 9 (%@#!) support - change fopen() mode from "a" to "w" in test code. - bump its serial num to 2. - test/acinclude.m4: same sdl2.m4 updates.
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
diff --git a/sdl2.m4 b/sdl2.m4
index 0a73bc7..0719042 100644
--- a/sdl2.m4
+++ b/sdl2.m4
@@ -7,14 +7,15 @@
#
# Changelog:
# * also look for SDL2.framework under Mac OS X
+# * removed HP/UX 9 support.
-# serial 1
+# serial 2
dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL2],
-[dnl
+[dnl
dnl Get the cflags and libraries from the sdl2-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
@@ -112,38 +113,16 @@ dnl
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include "SDL.h"
-char*
-my_strdup (char *str)
-{
- char *new_str;
-
- if (str)
- {
- new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
- strcpy (new_str, str);
- }
- else
- new_str = NULL;
-
- return new_str;
-}
-
int main (int argc, char *argv[])
{
int major, minor, micro;
- char *tmp_version;
+ FILE *fp = fopen("conf.sdltest", "w");
- /* This hangs on some systems (?)
- system ("touch conf.sdltest");
- */
- { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+ if (fp) fclose(fp);
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = my_strdup("$min_sdl_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
+ if (sscanf("$min_sdl_version", "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}
diff --git a/test/acinclude.m4 b/test/acinclude.m4
index e2180a3..290929d 100644
--- a/test/acinclude.m4
+++ b/test/acinclude.m4
@@ -5,13 +5,13 @@
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
-# serial 1
+# serial 2
dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL2],
-[dnl
+[dnl
dnl Get the cflags and libraries from the sdl2-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
@@ -83,38 +83,16 @@ dnl
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include "SDL.h"
-char*
-my_strdup (char *str)
-{
- char *new_str;
-
- if (str)
- {
- new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
- strcpy (new_str, str);
- }
- else
- new_str = NULL;
-
- return new_str;
-}
-
int main (int argc, char *argv[])
{
int major, minor, micro;
- char *tmp_version;
+ FILE *fp = fopen("conf.sdltest", "w");
- /* This hangs on some systems (?)
- system ("touch conf.sdltest");
- */
- { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+ if (fp) fclose(fp);
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = my_strdup("$min_sdl_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
+ if (sscanf("$min_sdl_version", "%d.%d.%d", &major, &minor, µ) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}