diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-10-15 10:07:02 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-10-15 10:09:41 -0400 |
commit | c3ea8e0272b470e7704e59244c3ef9bc3a0ac7ef (patch) | |
tree | bb528fc56c6055e07fca2d3dc834dcf2e736ce4b | |
parent | 407fc23f3f86d5caf665d9bca14e498273ae4dae (diff) |
Feature test for getline in br_ips
-rw-r--r-- | tools/br_ips/br_ips.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/br_ips/br_ips.c b/tools/br_ips/br_ips.c index 440705cab..9400ae1f8 100644 --- a/tools/br_ips/br_ips.c +++ b/tools/br_ips/br_ips.c @@ -1,4 +1,3 @@ -#define _POSIX_C_SOURCE 200808L // Don't use GNU getline #include <stdio.h> #include <stdint.h> #include <stdlib.h> @@ -20,6 +19,7 @@ static const char HELP[] = "br_ips\n" "Options:\n" " -h - show this message and exit\n"; +#if !defined(__CYGWIN32__) && !defined(__APPLE__) && (_POSIX_C_SOURCE < 200809L || !_GNU_SOURCE) static int getline(char ** lineptr, size_t * n, FILE * stream) { // Static implementation of GNU getline int i = 0; @@ -49,6 +49,7 @@ static int getline(char ** lineptr, size_t * n, FILE * stream) { buf[i] = 0; return i; } +#endif static void getIncbinsFromFile(hunk_t ** hunks, size_t * num, size_t * maxnum, const char * fname, char ** strbuf, size_t * buffersize) { // Recursively find incbinned segments and encode them as hunks. |