Move SC_PRIsizet to compat.h

Define the printf format macro for size_t in compat.h so that it can be
used from anywhere.

PR #3005 <https://github.com/Genymobile/scrcpy/pull/3005>
This commit is contained in:
Romain Vimont 2022-02-05 18:55:10 +01:00
parent 0eadf95a3e
commit 8c50342fb2
2 changed files with 2 additions and 3 deletions

View file

@ -8,8 +8,10 @@
#ifndef __WIN32 #ifndef __WIN32
# define PRIu64_ PRIu64 # define PRIu64_ PRIu64
# define SC_PRIsizet "zu"
#else #else
# define PRIu64_ "I64u" // Windows... # define PRIu64_ "I64u" // Windows...
# define SC_PRIsizet "Iu"
#endif #endif
// In ffmpeg/doc/APIchanges: // In ffmpeg/doc/APIchanges:

View file

@ -12,8 +12,6 @@
# include <winsock2.h> # include <winsock2.h>
# include <windows.h> # include <windows.h>
# define SC_PRIexitcode "lu" # define SC_PRIexitcode "lu"
// <https://stackoverflow.com/a/44383330/1987178>
# define SC_PRIsizet "Iu"
# define SC_PROCESS_NONE NULL # define SC_PROCESS_NONE NULL
# define SC_EXIT_CODE_NONE -1UL // max value as unsigned long # define SC_EXIT_CODE_NONE -1UL // max value as unsigned long
typedef HANDLE sc_pid; typedef HANDLE sc_pid;
@ -23,7 +21,6 @@
#else #else
# include <sys/types.h> # include <sys/types.h>
# define SC_PRIsizet "zu"
# define SC_PRIexitcode "d" # define SC_PRIexitcode "d"
# define SC_PROCESS_NONE -1 # define SC_PROCESS_NONE -1
# define SC_EXIT_CODE_NONE -1 # define SC_EXIT_CODE_NONE -1