acinclude/ac_check_define.m4
author Ryan C. Gordon <icculus@icculus.org>
Mon, 29 Oct 2018 20:00:03 -0400
changeset 12369 68c87b40b434
parent 6491 03b7e6b0a8bf
permissions -rw-r--r--
winmain: Don't use SDL_malloc (or SDL_stack_alloc, which might be malloc).

Otherwise, we are using the allocator before the app can set up its own hooks.

Now we use VirtualAlloc, and WideCharToMultiByte (because SDL_iconv uses
SDL_malloc, too!) to get ready to call into SDL_main.

This also makes console_wmain() call into the same routines as everything
else, so we don't have to deal with those allocations, too. Hopefully we
end up with the same results from GetCommandLine() as we do in wargv.

Fixes Bugzilla #4340.
slouken@6491
     1
AC_DEFUN([AC_CHECK_DEFINE],[dnl
slouken@3342
     2
  AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1,
slouken@3342
     3
    AC_EGREP_CPP([YES_IS_DEFINED], [
slouken@3342
     4
#include <$2>
slouken@3342
     5
#ifdef $1
slouken@3342
     6
YES_IS_DEFINED
slouken@3342
     7
#endif
slouken@3342
     8
    ], ac_cv_define_$1=yes, ac_cv_define_$1=no)
slouken@3342
     9
  )
slouken@3342
    10
  if test "$ac_cv_define_$1" = "yes" ; then
slouken@3374
    11
    AC_DEFINE([HAVE_$1],[],[Added by AC_CHECK_DEFINE])
slouken@3342
    12
  fi
slouken@3342
    13
])dnl
slouken@3374
    14
AC_DEFINE([HAVE_$1],[],[Added by AC_CHECK_DEFINE])