Skip to content

Commit

Permalink
fix build on msys2 ucrt64
Browse files Browse the repository at this point in the history
recent version of msys2 runtime define macros for __argc in
/ucrt64/include/stdlib.h, that clash with our declaration of
getopt_long.

Reorder the includes to workaround the define issue and fix
compilation.
  • Loading branch information
dciabrin committed Jan 10, 2025
1 parent 2727eb3 commit 018eac9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#include <config.h>
#endif

#ifdef HAVE_GETOPT_LONG
#include <getopt.h>
#else
#include "getopt.h"
#endif

#include <stdlib.h>
#include <ctype.h>
#include <string.h>
Expand All @@ -29,12 +35,6 @@
#include <unistd.h>
#include <dirent.h>

#ifdef HAVE_GETOPT_LONG
#include <getopt.h>
#else
#include "getopt.h"
#endif

#include <zlib.h>
#include "unzip.h"
#include "SDL.h"
Expand Down

0 comments on commit 018eac9

Please sign in to comment.