Skip to content

Commit 44ff6e2

Browse files
committed
Support GNU Hurd.
Extend the existing `#ifdef` for Linux / MINT / WASI to check `__GNU__`, which sets the `_GNU_SOURCE` define needed to build on Hurd. Regenerate `configure` after that change. re kristapsdz/openrsync#36
1 parent cbe7493 commit 44ff6e2

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ cat << __HEREDOC__
715715
#if !defined(__GNUC__) || (__GNUC__ < 4)
716716
# define __attribute__(x)
717717
#endif
718-
#if defined(__linux__) || defined(__MINT__) || defined(__wasi__)
718+
#if defined(__linux__) || defined(__MINT__) || defined(__wasi__) || defined(__GNU__)
719719
# define _GNU_SOURCE /* memmem, memrchr, setresuid... */
720720
# define _DEFAULT_SOURCE /* le32toh, crypt, ... */
721721
#endif

configure.in

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ cat << __HEREDOC__
715715
#if !defined(__GNUC__) || (__GNUC__ < 4)
716716
# define __attribute__(x)
717717
#endif
718-
#if defined(__linux__) || defined(__MINT__) || defined(__wasi__)
718+
#if defined(__linux__) || defined(__MINT__) || defined(__wasi__) || defined(__GNU__)
719719
# define _GNU_SOURCE /* memmem, memrchr, setresuid... */
720720
# define _DEFAULT_SOURCE /* le32toh, crypt, ... */
721721
#endif

test-crypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if defined(__linux__) || defined(__wasi__)
1+
#if defined(__linux__) || defined(__wasi__) || defined(__GNU__)
22
# define _DEFAULT_SOURCE /* new glibc */
33
# define _XOPEN_SOURCE /* old glibc */
44
#endif

test-endian_h.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if defined(__linux__) || defined(__wasi__)
1+
#if defined(__linux__) || defined(__wasi__) || defined(__GNU__)
22
# define _DEFAULT_SOURCE
33
#endif
44
#include <endian.h>

test-memrchr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if defined(__linux__) || defined(__MINT__) || defined(__wasi__)
1+
#if defined(__linux__) || defined(__MINT__) || defined(__wasi__) || defined(__GNU__)
22
#define _GNU_SOURCE /* See test-*.c what needs this. */
33
#endif
44
#include <string.h>

tests.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ main(void)
8585
}
8686
#endif /* TEST_CAPSICUM */
8787
#if TEST_CRYPT
88-
#if defined(__linux__) || defined(__wasi__)
88+
#if defined(__linux__) || defined(__wasi__) || defined(__GNU__)
8989
# define _DEFAULT_SOURCE /* new glibc */
9090
# define _XOPEN_SOURCE /* old glibc */
9191
#endif
@@ -126,7 +126,7 @@ main(void)
126126
}
127127
#endif /* TEST_CRYPT_NEWHASH */
128128
#if TEST_ENDIAN_H
129-
#if defined(__linux__) || defined(__wasi__)
129+
#if defined(__linux__) || defined(__wasi__) || defined(__GNU__)
130130
# define _DEFAULT_SOURCE
131131
#endif
132132
#include <endian.h>
@@ -336,7 +336,7 @@ main(void)
336336
}
337337
#endif /* TEST_MEMMEM */
338338
#if TEST_MEMRCHR
339-
#if defined(__linux__) || defined(__MINT__) || defined(__wasi__)
339+
#if defined(__linux__) || defined(__MINT__) || defined(__wasi__) || defined(__GNU__)
340340
#define _GNU_SOURCE /* See test-*.c what needs this. */
341341
#endif
342342
#include <string.h>

0 commit comments

Comments
 (0)