Configure feature test macros in meson

Refs #2807 <https://github.com/Genymobile/scrcpy/pull/2807>

Co-authored-by: RipleyTom <RipleyTom@users.noreply.github.com>
This commit is contained in:
Romain Vimont 2021-11-20 21:24:56 +01:00
parent 2d6a96776c
commit 95769eb87b
3 changed files with 8 additions and 10 deletions

View File

@ -44,11 +44,19 @@ if host_machine.system() == 'windows'
'src/sys/win/file.c',
'src/sys/win/process.c',
]
add_project_arguments('-D_WIN32_WINNT=0x0600', language: 'c')
add_project_arguments('-DWINVER=0x0600', language: 'c')
else
src += [
'src/sys/unix/file.c',
'src/sys/unix/process.c',
]
add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: 'c')
add_project_arguments('-D_XOPEN_SOURCE=700', language: 'c')
add_project_arguments('-D_GNU_SOURCE', language: 'c')
if host_machine.system() == 'darwin'
add_project_arguments('-D_DARWIN_C_SOURCE', language: 'c')
endif
endif
v4l2_support = host_machine.system() == 'linux'

View File

@ -1,13 +1,6 @@
#ifndef COMPAT_H
#define COMPAT_H
#define _POSIX_C_SOURCE 200809L
#define _XOPEN_SOURCE 700
#define _GNU_SOURCE
#ifdef __APPLE__
# define _DARWIN_C_SOURCE
#endif
#include <libavformat/version.h>
#include <SDL2/SDL_version.h>

View File

@ -1,6 +1,3 @@
// <https://devblogs.microsoft.com/oldnewthing/20111216-00/?p=8873>
#define _WIN32_WINNT 0x0600 // For extended process API
#include "util/process.h"
#include <processthreadsapi.h>