aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meson.build10
-rw-r--r--src/.clang-tidy2
-rw-r--r--src/serdi.c2
-rw-r--r--src/system.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index bf29d82c..890c8894 100644
--- a/meson.build
+++ b/meson.build
@@ -105,6 +105,12 @@ sources = [
# System libraries
m_dep = cc.find_library('m', required: false)
+# System defines needed to expose platform APIs
+platform_args = []
+if host_machine.system() != 'windows'
+ platform_args += ['-D_POSIX_C_SOURCE=200809L']
+endif
+
# Determine library type and the flags needed to build it
library_name = versioned_name
if get_option('default_library') == 'both'
@@ -136,7 +142,7 @@ libserd = build_target(
sources,
version: meson.project_version(),
include_directories: include_directories(['include']),
- c_args: c_warnings + library_args,
+ c_args: c_warnings + platform_args + library_args,
dependencies: m_dep,
gnu_symbol_visibility: 'hidden',
install: true,
@@ -163,7 +169,7 @@ if get_option('utils')
endif
serdi = executable('serdi', 'src/serdi.c',
- c_args: c_warnings + prog_args,
+ c_args: c_warnings + platform_args + prog_args,
link_args: tool_link_args,
install: true,
dependencies: serd_dep)
diff --git a/src/.clang-tidy b/src/.clang-tidy
index b47291f2..d39ee7e8 100644
--- a/src/.clang-tidy
+++ b/src/.clang-tidy
@@ -7,8 +7,6 @@ Checks: >
-bugprone-easily-swappable-parameters,
-bugprone-reserved-identifier,
-bugprone-suspicious-string-compare,
- -cert-dcl37-c,
- -cert-dcl51-cpp,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-concurrency-mt-unsafe,
-google-readability-todo,
diff --git a/src/serdi.c b/src/serdi.c
index 4e06ac95..06d83816 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -14,8 +14,6 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _POSIX_C_SOURCE 200809L /* for fileno and posix_fadvise */
-
#include "serd_config.h"
#include "string_utils.h"
diff --git a/src/system.c b/src/system.c
index f706902d..c3e31912 100644
--- a/src/system.c
+++ b/src/system.c
@@ -14,8 +14,6 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _POSIX_C_SOURCE 200809L /* for posix_memalign and posix_fadvise */
-
#include "system.h"
#include "serd_config.h"