Skip to content

Commit 356bb12

Browse files
pks-tgitster
authored andcommitted
compat/msvc: split out POSIX-related bits
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bc09fb1 commit 356bb12

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed
File renamed without changes.

compat/msvc/compat-util.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef COMPAT_MSVC_COMPAT_UTIL_H
2+
#define COMPAT_MSVC_COMPAT_UTIL_H
3+
4+
#include "compat/msvc/posix.h"
5+
#include "compat/mingw/compat-util.h"
6+
7+
#endif /* COMPAT_MSVC_COMPAT_UTIL_H */

compat/msvc.h renamed to compat/msvc/posix.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef __MSVC__HEAD
2-
#define __MSVC__HEAD
1+
#ifndef COMPAT_MSVC_POSIX_H
2+
#define COMPAT_MSVC_POSIX_H
33

44
#include <direct.h>
55
#include <process.h>
@@ -28,6 +28,6 @@ typedef int sigset_t;
2828
/* open for reading, writing, or both (not in fcntl.h) */
2929
#define O_ACCMODE (_O_RDONLY | _O_WRONLY | _O_RDWR)
3030

31-
#include "compat/mingw/compat-util.h"
31+
#include "compat/mingw/posix.h"
3232

33-
#endif
33+
#endif /* COMPAT_MSVC_POSIX_H */

config.mak.uname

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ endif
495495
AR = compat/vcbuild/scripts/lib.pl
496496
CFLAGS =
497497
BASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
498-
COMPAT_OBJS = compat/msvc.o compat/winansi.o \
498+
COMPAT_OBJS = compat/msvc/compat-util.o compat/winansi.o \
499499
compat/win32/flush.o \
500500
compat/win32/path-utils.o \
501501
compat/win32/pthread.o compat/win32/syslog.o \
@@ -541,7 +541,7 @@ endif
541541

542542
EXTRA_PROGRAMS += headless-git$X
543543

544-
compat/msvc.o: compat/msvc.c compat/mingw/compat-util.c GIT-CFLAGS
544+
compat/msvc/compat-util.o: compat/msvc/compat-util.c compat/mingw/compat-util.c GIT-CFLAGS
545545
endif
546546
ifeq ($(uname_S),Interix)
547547
NO_INITGROUPS = YesPlease

meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,6 @@ if host_machine.system() == 'cygwin'
10541054
]
10551055
elif host_machine.system() == 'windows'
10561056
libgit_sources += [
1057-
'compat/mingw/compat-util.c',
10581057
'compat/winansi.c',
10591058
'compat/win32/flush.c',
10601059
'compat/win32/path-utils.c',
@@ -1081,6 +1080,9 @@ elif host_machine.system() == 'windows'
10811080
libgit_include_directories += 'compat/win32'
10821081
if compiler.get_id() == 'msvc'
10831082
libgit_include_directories += 'compat/vcbuild/include'
1083+
libgit_sources += 'compat/msvc/compat-util.c'
1084+
else
1085+
libgit_sources += 'compat/mingw/compat-util.c'
10841086
endif
10851087
endif
10861088

0 commit comments

Comments
 (0)