diff --git a/.gitignore b/.gitignore index e910fd5..1ab64a4 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ m4/lt~obsolete.m4 src/adplay src/config.h* src/.libs/ +*.exe diff --git a/configure.ac b/configure.ac index 65ef204..66c1ecb 100644 --- a/configure.ac +++ b/configure.ac @@ -196,6 +196,9 @@ if test ${enable_output_sdl:=yes} = yes; then ) AC_LANG_POP(C) fi + dnl strip away options that would turn our application from console to a windows GUI application + SDL_CFLAGS=`echo $SDL_CFLAGS |sed -e 's/-Dmain=SDL_main//g'` + SDL_LIBS=`echo $SDL_LIBS | sed -e 's/-mwindows/-mconsole/g' -e 's/-lSDLmain//g' -e 's/-lSDL2main//g'` fi # ALSA output diff --git a/src/getopt.h b/src/getopt.h index b0147e9..78fc285 100644 --- a/src/getopt.h +++ b/src/getopt.h @@ -27,6 +27,10 @@ extern "C" { #endif +// in mingw, __argc and __argv are special +#undef __argc +#undef __argv + /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. diff --git a/src/sdl.cc b/src/sdl.cc index 16881c3..2935496 100644 --- a/src/sdl.cc +++ b/src/sdl.cc @@ -17,6 +17,8 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include +#include #include #include "sdl_driver.h" diff --git a/src/sdl_driver.h b/src/sdl_driver.h index 7934408..e4fa0fb 100644 --- a/src/sdl_driver.h +++ b/src/sdl_driver.h @@ -20,6 +20,8 @@ #ifndef H_SDL #define H_SDL +#define SDL_MAIN_HANDLED 1 + #include #include "output.h"