Skip to content

Commit 5cb6e04

Browse files
committed
Issue 113 - move APPLE ifdef in direwolf.h
1 parent 9c2b8f9 commit 5cb6e04

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

direwolf.h

+21-12
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@
3232
#endif
3333

3434

35-
#ifdef __APPLE__
36-
37-
// https://groups.yahoo.com/neo/groups/direwolf_packet/conversations/messages/2072
38-
39-
// I think we should put it here, so it will apply to all files,
40-
// rather than only in ptt.c.
41-
42-
#define __DARWIN_C_LEVEL __DARWIN_C_FULL
43-
44-
#endif
45-
46-
4735
/*
4836
* Previously, we could handle only a single audio device.
4937
* This meant we could have only two radio channels.
@@ -131,6 +119,27 @@
131119
#endif
132120

133121

122+
#ifdef __APPLE__
123+
124+
// https://groups.yahoo.com/neo/groups/direwolf_packet/conversations/messages/2072
125+
126+
// The original suggestion was to add this to only ptt.c.
127+
// I thought it would make sense to put it here, so it will apply to all files,
128+
// consistently, rather than only one file ptt.c.
129+
130+
// The placement of this is critical. Putting it earlier was a problem.
131+
// https://github.com/wb2osz/direwolf/issues/113
132+
133+
// It needs to be after the include pthread.h because
134+
// pthread.h pulls in <sys/cdefs.h>, which redefines __DARWIN_C_LEVEL back to ansi,
135+
// which breaks things.
136+
// Maybe it should just go in ptt.c as originally suggested.
137+
138+
#define __DARWIN_C_LEVEL __DARWIN_C_FULL
139+
140+
#endif
141+
142+
134143
/* Not sure where to put these. */
135144

136145
/* Prefix with DW_ because /usr/include/gps.h uses a couple of these names. */

0 commit comments

Comments
 (0)