diff --git a/app/src/command.h b/app/src/command.h index 9fc81c1c..555b5435 100644 --- a/app/src/command.h +++ b/app/src/command.h @@ -4,38 +4,8 @@ #include #include -#ifdef _WIN32 - - // not needed here, but winsock2.h must never be included AFTER windows.h -# include -# include -# define PATH_SEPARATOR '\\' -# define PRIexitcode "lu" -// -# ifdef _WIN64 -# define PRIsizet PRIu64 -# else -# define PRIsizet PRIu32 -# endif -# define PROCESS_NONE NULL -# define NO_EXIT_CODE -1u // max value as unsigned - typedef HANDLE process_t; - typedef DWORD exit_code_t; - -#else - -# include -# define PATH_SEPARATOR '/' -# define PRIsizet "zu" -# define PRIexitcode "d" -# define PROCESS_NONE -1 -# define NO_EXIT_CODE -1 - typedef pid_t process_t; - typedef int exit_code_t; - -#endif - #include "config.h" +#include "common.h" enum process_result { PROCESS_SUCCESS, diff --git a/app/src/common.h b/app/src/common.h index e5cbe953..caa1bba3 100644 --- a/app/src/common.h +++ b/app/src/common.h @@ -5,6 +5,37 @@ #include "config.h" +#ifdef _WIN32 + + // not needed here, but winsock2.h must never be included AFTER windows.h +# include +# include +# define PATH_SEPARATOR '\\' +# define PRIexitcode "lu" +// +# ifdef _WIN64 +# define PRIsizet PRIu64 +# else +# define PRIsizet PRIu32 +# endif +# define PROCESS_NONE NULL +# define NO_EXIT_CODE -1u // max value as unsigned + typedef HANDLE process_t; + typedef DWORD exit_code_t; + +#else + +# include +# define PATH_SEPARATOR '/' +# define PRIsizet "zu" +# define PRIexitcode "d" +# define PROCESS_NONE -1 +# define NO_EXIT_CODE -1 + typedef pid_t process_t; + typedef int exit_code_t; + +#endif + #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0])) #define MIN(X,Y) (X) < (Y) ? (X) : (Y) #define MAX(X,Y) (X) > (Y) ? (X) : (Y)