similarity index 100%
rename from compat/msvc.c
rename to compat/msvc/compat-util.c
new file mode 100644
@@ -0,0 +1,7 @@
+#ifndef COMPAT_MSVC_COMPAT_UTIL_H
+#define COMPAT_MSVC_COMPAT_UTIL_H
+
+#include "compat/msvc/posix.h"
+#include "compat/mingw/compat-util.h"
+
+#endif /* COMPAT_MSVC_COMPAT_UTIL_H */
similarity index 86%
rename from compat/msvc.h
rename to compat/msvc/posix.h
@@ -1,5 +1,5 @@
-#ifndef __MSVC__HEAD
-#define __MSVC__HEAD
+#ifndef COMPAT_MSVC_POSIX_H
+#define COMPAT_MSVC_POSIX_H
#include <direct.h>
#include <process.h>
@@ -28,6 +28,6 @@ typedef int sigset_t;
/* open for reading, writing, or both (not in fcntl.h) */
#define O_ACCMODE (_O_RDONLY | _O_WRONLY | _O_RDWR)
-#include "compat/mingw/compat-util.h"
+#include "compat/mingw/posix.h"
-#endif
+#endif /* COMPAT_MSVC_POSIX_H */
@@ -495,7 +495,7 @@ endif
AR = compat/vcbuild/scripts/lib.pl
CFLAGS =
BASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
- COMPAT_OBJS = compat/msvc.o compat/winansi.o \
+ COMPAT_OBJS = compat/msvc/compat-util.o compat/winansi.o \
compat/win32/flush.o \
compat/win32/path-utils.o \
compat/win32/pthread.o compat/win32/syslog.o \
@@ -541,7 +541,7 @@ endif
EXTRA_PROGRAMS += headless-git$X
-compat/msvc.o: compat/msvc.c compat/mingw/compat-util.c GIT-CFLAGS
+compat/msvc/compat-util.o: compat/msvc/compat-util.c compat/mingw/compat-util.c GIT-CFLAGS
endif
ifeq ($(uname_S),Interix)
NO_INITGROUPS = YesPlease
@@ -1054,7 +1054,6 @@ if host_machine.system() == 'cygwin'
]
elif host_machine.system() == 'windows'
libgit_sources += [
- 'compat/mingw/compat-util.c',
'compat/winansi.c',
'compat/win32/flush.c',
'compat/win32/path-utils.c',
@@ -1081,6 +1080,9 @@ elif host_machine.system() == 'windows'
libgit_include_directories += 'compat/win32'
if compiler.get_id() == 'msvc'
libgit_include_directories += 'compat/vcbuild/include'
+ libgit_sources += 'compat/msvc/compat-util.c'
+ else
+ libgit_sources += 'compat/mingw/compat-util.c'
endif
endif
Split out the POSIX-related bits from "compat/msvc.h". This is in preparation for splitting up "git-compat-utils.h" into a header that provides POSIX-compatibility and a header that provides common wrappers used by the Git project. Signed-off-by: Patrick Steinhardt <ps@pks.im> --- compat/{msvc.c => msvc/compat-util.c} | 0 compat/msvc/compat-util.h | 7 +++++++ compat/{msvc.h => msvc/posix.h} | 8 ++++---- config.mak.uname | 4 ++-- meson.build | 4 +++- 5 files changed, 16 insertions(+), 7 deletions(-)