Merge pull request #3421 from niacat/posix_c_source

Define _POSIX_C_SOURCE to be 200112L, as a minimum for C99.
This commit is contained in:
Manuel Pégourié-Gonnard 2020-06-18 13:01:38 +02:00 committed by GitHub
commit d335f2b6cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View file

@ -0,0 +1,2 @@
Bugfix
* Set _POSIX_C_SOURCE to at least 200112L in C99 code. Reported in #3420 and fix submitted in #3421 by Nia Alarie.

View file

@ -22,7 +22,7 @@
/* Enable definition of fileno() even when compiling with -std=c99. Must be /* Enable definition of fileno() even when compiling with -std=c99. Must be
* set before config.h, which pulls in glibc's features.h indirectly. * set before config.h, which pulls in glibc's features.h indirectly.
* Harmless on other platforms. */ * Harmless on other platforms. */
#define _POSIX_C_SOURCE 1 #define _POSIX_C_SOURCE 200112L
#if !defined(MBEDTLS_CONFIG_FILE) #if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h" #include "mbedtls/config.h"

View file

@ -23,7 +23,7 @@
/* Enable definition of fileno() even when compiling with -std=c99. Must be /* Enable definition of fileno() even when compiling with -std=c99. Must be
* set before config.h, which pulls in glibc's features.h indirectly. * set before config.h, which pulls in glibc's features.h indirectly.
* Harmless on other platforms. */ * Harmless on other platforms. */
#define _POSIX_C_SOURCE 1 #define _POSIX_C_SOURCE 200112L
#if !defined(MBEDTLS_CONFIG_FILE) #if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h" #include "mbedtls/config.h"

View file

@ -21,7 +21,7 @@
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#if !defined(_POSIX_C_SOURCE) #if !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 1 // for fileno() from <stdio.h> #define _POSIX_C_SOURCE 200112L // for fileno() from <stdio.h>
#endif #endif
#endif #endif