Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
avoid PATH_MAX redefinition in doomtype.h (#469)
Browse files Browse the repository at this point in the history
* avoid PATH_MAX redefinition in doomtype.h

Fixes #468, does it @RamonUnch ?

* move limits.h inclusion up before checking for PATH_MAX
  • Loading branch information
fabiangreffrath authored Feb 10, 2022
1 parent 863702b commit e2ef111
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions prboom2/src/doomtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef unsigned char byte;
#define BETWEEN(l,u,x) ((l)>(x)?(l):(x)>(u)?(u):(x))
#endif

#include <limits.h>

/* cph - Wrapper for the long long type, as Win32 used a different name.
* Except I don't know what to test as it's compiler specific
Expand All @@ -75,14 +76,17 @@ typedef __int64 int_64_t;
typedef unsigned __int64 uint_64_t;
// define compiled-specific long-long contstant notation here
#define LONGLONG(num) (uint_64_t)num
#undef PATH_MAX
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif

#ifndef PATH_MAX
#define PATH_MAX 1024
#ifdef MAX_PATH
#define PATH_MAX MAX_PATH
#else
#define PATH_MAX 1024
#endif
#endif

#ifdef __GNUC__
Expand Down Expand Up @@ -118,9 +122,6 @@ typedef unsigned __int64 uint_64_t;
#define INLINE inline /* use standard inline */
#endif

/* CPhipps - use limits.h instead of depreciated values.h */
#include <limits.h>

/* cph - move compatibility levels here so we can use them in d_server.c */
typedef enum {
doom_12_compatibility, /* Doom v1.2 */
Expand Down

0 comments on commit e2ef111

Please sign in to comment.