Skip to content

Commit 428f05b

Browse files
committed
Make GIT_WIN32 an internal declaration
The `GIT_WIN32` macro should only be used internally; keep it as such.
1 parent 4282cbd commit 428f05b

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

include/git2/common.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ typedef size_t size_t;
7373
# define GIT_FORMAT_PRINTF(a,b) /* empty */
7474
#endif
7575

76-
/** Defined when building on Windows (but not via cygwin) */
77-
#if (defined(_WIN32)) && !defined(__CYGWIN__)
78-
#define GIT_WIN32 1
79-
#endif
80-
8176
#ifdef __amigaos4__
8277
#include <netinet/in.h>
8378
#endif
@@ -101,10 +96,10 @@ GIT_BEGIN_DECL
10196
* environment variable). A semi-colon ";" is used on Windows and
10297
* AmigaOS, and a colon ":" for all other systems.
10398
*/
104-
#if defined(GIT_WIN32) || defined(AMIGA)
105-
#define GIT_PATH_LIST_SEPARATOR ';'
99+
#if (defined(_WIN32) && !defined(__CYGWIN__)) || defined(AMIGA)
100+
# define GIT_PATH_LIST_SEPARATOR ';'
106101
#else
107-
#define GIT_PATH_LIST_SEPARATOR ':'
102+
# define GIT_PATH_LIST_SEPARATOR ':'
108103
#endif
109104

110105
/**

src/util/git2_util.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ typedef struct git_str git_str;
4949
# define GIT_WARN_UNUSED_RESULT
5050
#endif
5151

52+
#if (defined(_WIN32)) && !defined(__CYGWIN__)
53+
# define GIT_WIN32 1
54+
#endif
55+
5256
#include <assert.h>
5357
#include <errno.h>
5458
#include <limits.h>

src/util/util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
#ifndef INCLUDE_util_h__
88
#define INCLUDE_util_h__
99

10-
#ifndef GIT_WIN32
11-
# include <ctype.h>
12-
#endif
13-
1410
#include "str.h"
1511
#include "git2_util.h"
1612
#include "strnlen.h"
1713
#include "thread.h"
1814

15+
#ifndef GIT_WIN32
16+
# include <ctype.h>
17+
#endif
18+
1919
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
2020
#define bitsizeof(x) (CHAR_BIT * sizeof(x))
2121
#define MSB(x, bits) ((x) & (~UINT64_C(0) << (bitsizeof(x) - (bits))))

0 commit comments

Comments
 (0)