mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 19:45:00 +00:00
Move platorm-specific defines to common.h
They could be useful anywhere.
This commit is contained in:
parent
71df3175bd
commit
78f566bd6d
2 changed files with 32 additions and 31 deletions
|
@ -4,38 +4,8 @@
|
|||
#include <stdbool.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
// not needed here, but winsock2.h must never be included AFTER windows.h
|
||||
# include <winsock2.h>
|
||||
# include <windows.h>
|
||||
# define PATH_SEPARATOR '\\'
|
||||
# define PRIexitcode "lu"
|
||||
// <https://stackoverflow.com/a/44383330/1987178>
|
||||
# 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 <sys/types.h>
|
||||
# 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,
|
||||
|
|
|
@ -5,6 +5,37 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
// not needed here, but winsock2.h must never be included AFTER windows.h
|
||||
# include <winsock2.h>
|
||||
# include <windows.h>
|
||||
# define PATH_SEPARATOR '\\'
|
||||
# define PRIexitcode "lu"
|
||||
// <https://stackoverflow.com/a/44383330/1987178>
|
||||
# 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 <sys/types.h>
|
||||
# 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)
|
||||
|
|
Loading…
Add table
Reference in a new issue