Skip to content

Commit 6c40dbd

Browse files
committed
Regroup Windows-ifdefs in command.h
1 parent 477c0a2 commit 6c40dbd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

app/src/command.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33

44
#include <inttypes.h>
55
#include <SDL2/SDL_stdinc.h>
6-
#include <SDL2/SDL_platform.h>
76

8-
// <https://stackoverflow.com/a/44383330/1987178>
97
#ifdef _WIN32
8+
9+
# include <winsock2.h> // not needed here, but must never be included AFTER windows.h
10+
# include <windows.h>
1011
# define PRIexitcode "lu"
12+
// <https://stackoverflow.com/a/44383330/1987178>
1113
# ifdef _WIN64
1214
# define PRIsizet PRIu64
1315
# else
1416
# define PRIsizet PRIu32
1517
# endif
16-
#else
17-
# define PRIsizet "zu"
18-
# define PRIexitcode "d"
19-
#endif
20-
21-
#ifdef __WINDOWS__
22-
# include <winsock2.h> // not needed here, but must never be included AFTER windows.h
23-
# include <windows.h>
2418
# define PROCESS_NONE NULL
2519
typedef HANDLE process_t;
2620
typedef DWORD exit_code_t;
21+
2722
#else
23+
2824
# include <sys/types.h>
25+
# define PRIsizet "zu"
26+
# define PRIexitcode "d"
2927
# define PROCESS_NONE -1
3028
typedef pid_t process_t;
3129
typedef int exit_code_t;
30+
3231
#endif
32+
3333
# define NO_EXIT_CODE -1
3434

3535
enum process_result {

0 commit comments

Comments
 (0)