Skip to content

Commit

Permalink
Configure feature test macros in meson
Browse files Browse the repository at this point in the history
Refs #2807 <#2807>

Co-authored-by: RipleyTom <[email protected]>
  • Loading branch information
rom1v and RipleyTom committed Nov 20, 2021
1 parent 2d6a967 commit 95769eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 8 additions & 0 deletions app/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 0 additions & 7 deletions app/src/compat.h
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
3 changes: 0 additions & 3 deletions app/src/sys/win/process.c
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit 95769eb

Please sign in to comment.