From 87d90976b15edab02bdf5fb7cb3c64b03bf4eb83 Mon Sep 17 00:00:00 2001 From: Evan Burkey Date: Tue, 9 Jul 2024 12:57:33 -0700 Subject: [PATCH] add POSIX --- CMakeLists.txt | 4 ++++ Makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdfc1e6..4cadfd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.17) project(flint C) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux")) + add_compile_definitions(flint __USE_XOPEN_EXTENDED) +endif() + set(CMAKE_C_STANDARD 99) include_directories(include) diff --git a/Makefile b/Makefile index 5aa38ee..2821104 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY : clean tests all manual -CFLAGS = -std=c99 -Iinclude -pedantic +CFLAGS = -std=c99 -Iinclude -pedantic -D_POSIX_C_SOURCE=200112L WARNINGS= -Wall -Wextra LDFLAGS = -fPIC -shared MACROS= -D_POSIX_C_SOURCE=1