Make GIT_WIN32 an internal declaration

The `GIT_WIN32` macro should only be used internally; keep it as such.
This commit is contained in:
Edward Thomson
2024-11-16 12:43:16 +00:00
parent f54d4601ce
commit 455ce40994
3 changed files with 11 additions and 12 deletions

View File

@@ -73,11 +73,6 @@ typedef size_t size_t;
# define GIT_FORMAT_PRINTF(a,b) /* empty */
#endif
/** Defined when building on Windows (but not via cygwin) */
#if (defined(_WIN32)) && !defined(__CYGWIN__)
#define GIT_WIN32 1
#endif
#ifdef __amigaos4__
#include <netinet/in.h>
#endif
@@ -101,10 +96,10 @@ GIT_BEGIN_DECL
* environment variable). A semi-colon ";" is used on Windows and
* AmigaOS, and a colon ":" for all other systems.
*/
#if defined(GIT_WIN32) || defined(AMIGA)
#define GIT_PATH_LIST_SEPARATOR ';'
#if (defined(_WIN32) && !defined(__CYGWIN__)) || defined(AMIGA)
# define GIT_PATH_LIST_SEPARATOR ';'
#else
#define GIT_PATH_LIST_SEPARATOR ':'
# define GIT_PATH_LIST_SEPARATOR ':'
#endif
/**

View File

@@ -49,6 +49,10 @@ typedef struct git_str git_str;
# define GIT_WARN_UNUSED_RESULT
#endif
#if (defined(_WIN32)) && !defined(__CYGWIN__)
# define GIT_WIN32 1
#endif
#include <assert.h>
#include <errno.h>
#include <limits.h>

View File

@@ -7,15 +7,15 @@
#ifndef INCLUDE_util_h__
#define INCLUDE_util_h__
#ifndef GIT_WIN32
# include <ctype.h>
#endif
#include "str.h"
#include "git2_util.h"
#include "strnlen.h"
#include "thread.h"
#ifndef GIT_WIN32
# include <ctype.h>
#endif
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
#define bitsizeof(x) (CHAR_BIT * sizeof(x))
#define MSB(x, bits) ((x) & (~UINT64_C(0) << (bitsizeof(x) - (bits))))