Fixed the method for checking whether compiling for Windows.
This commit is contained in:
parent
0017cffcf9
commit
427f92ce2b
|
@ -31,16 +31,12 @@ PKG_CHECK_EXISTS([SDL2_mixer], [
|
||||||
|
|
||||||
AC_ARG_VAR([SF_SCREEN_WIDTH], [The width of the game window in pixels])
|
AC_ARG_VAR([SF_SCREEN_WIDTH], [The width of the game window in pixels])
|
||||||
AC_ARG_VAR([SF_SCREEN_HEIGHT], [The height of the game window in pixels])
|
AC_ARG_VAR([SF_SCREEN_HEIGHT], [The height of the game window in pixels])
|
||||||
AC_ARG_VAR([SF_WINDOWS], [Set to "1" to indicate that the build is for Windows])
|
|
||||||
AS_IF([test -n "$SF_SCREEN_WIDTH"], [
|
AS_IF([test -n "$SF_SCREEN_WIDTH"], [
|
||||||
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DSCREEN_WIDTH=$SF_SCREEN_WIDTH"
|
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DSCREEN_WIDTH=$SF_SCREEN_WIDTH"
|
||||||
])
|
])
|
||||||
AS_IF([test -n "$SF_SCREEN_HEIGHT"], [
|
AS_IF([test -n "$SF_SCREEN_HEIGHT"], [
|
||||||
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DSCREEN_HEIGHT=$SF_SCREEN_HEIGHT"
|
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DSCREEN_HEIGHT=$SF_SCREEN_HEIGHT"
|
||||||
])
|
])
|
||||||
AS_IF([test -n "$SF_WINDOWS"], [
|
|
||||||
STARFIGHTER_CFLAGS="$STARFIGHTER_CFLAGS -DWINDOWS"
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_SUBST([STARFIGHTER_CFLAGS])
|
AC_SUBST([STARFIGHTER_CFLAGS])
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifndef WINDOWS
|
#ifndef _WIN32
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ void engine_setupConfigDirectory()
|
||||||
const char *userHome;
|
const char *userHome;
|
||||||
char dir[PATH_MAX];
|
char dir[PATH_MAX];
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef _WIN32
|
||||||
// XXX: This is a bad design, but I just can't be bothered to learn
|
// XXX: This is a bad design, but I just can't be bothered to learn
|
||||||
// the Windows API so I can do this properly. If anyone wants to
|
// the Windows API so I can do this properly. If anyone wants to
|
||||||
// make this point to the proper directory, be my guest!
|
// make this point to the proper directory, be my guest!
|
||||||
|
@ -176,7 +176,7 @@ void engine_setupConfigDirectory()
|
||||||
|
|
||||||
sprintf(dir, "%s/.config", userHome);
|
sprintf(dir, "%s/.config", userHome);
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef _WIN32
|
||||||
if ((mkdir(dir) != 0) && (errno != EEXIST))
|
if ((mkdir(dir) != 0) && (errno != EEXIST))
|
||||||
engine_showError(2, dir);
|
engine_showError(2, dir);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue