Skip to content

Commit d422a7e

Browse files
committed
minor: Fix redefinition warning (closes merbanan#3216)
1 parent 7a2b80f commit d422a7e

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/output_rtltcp.c

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@
7979
typedef SSIZE_T ssize_t;
8080
#endif
8181

82+
// _POSIX_HOST_NAME_MAX is broken in gcc-13 at least on MacOS
83+
#ifndef _POSIX_HOST_NAME_MAX
84+
//#warning The limits.h include is missing the _POSIX_HOST_NAME_MAX define.
85+
#define _POSIX_HOST_NAME_MAX 255
86+
#endif
87+
8288
// MSG_NOSIGNAL is Linux and most BSDs only, not macOS or Windows
8389
#ifndef MSG_NOSIGNAL
8490
#define MSG_NOSIGNAL 0

src/output_udp.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
#include <errno.h>
2424

2525
#include <limits.h>
26-
// _POSIX_HOST_NAME_MAX is broken in gcc-13 at least on MacOS
27-
#ifndef _POSIX_HOST_NAME_MAX
28-
//#warning The limits.h include is missing the _POSIX_HOST_NAME_MAX define.
29-
#define _POSIX_HOST_NAME_MAX 255
30-
#endif
3126
// gethostname() needs _XOPEN_SOURCE 500 on unistd.h
3227
#ifndef _XOPEN_SOURCE
3328
#define _XOPEN_SOURCE 500
@@ -75,6 +70,12 @@
7570
#define gai_strerror strerror
7671
#endif
7772

73+
// _POSIX_HOST_NAME_MAX is broken in gcc-13 at least on MacOS
74+
#ifndef _POSIX_HOST_NAME_MAX
75+
//#warning The limits.h include is missing the _POSIX_HOST_NAME_MAX define.
76+
#define _POSIX_HOST_NAME_MAX 255
77+
#endif
78+
7879
/* Datagram (UDP) client */
7980

8081
typedef struct {

0 commit comments

Comments
 (0)