Skip to content

Commit dc287d1

Browse files
daijoubuclaude
andcommitted
Revert socket.h guards: restore original unguarded includes
The previous fix guarded <sys/socket.h> with #ifdef __linux__, but this breaks macOS and Windows builds because: - serial_tcp.c and xplane.c are compiled on ALL SITL platforms - They require socket functions declared in target.h - Guarding the declarations makes them unavailable on macOS/Windows - This causes linker errors instead of fixing the issue Reverting to the original approach: - macOS has <sys/socket.h> (it's a POSIX system) - Windows with Cygwin has <sys/socket.h> - Only non-POSIX Windows needs different handling The original code with unguarded includes worked on macOS/Windows before the SocketCAN driver was added. Need to investigate the actual root cause of the CI failures without breaking the code on other platforms. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 4739bb8 commit dc287d1

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/main/target/SITL/target.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727
#include <stdint.h>
2828
#include <stdbool.h>
2929
#include <stddef.h>
30-
31-
#ifdef __linux__
3230
#include <sys/socket.h>
33-
#endif
3431

3532
#include <platform.h>
3633

@@ -208,10 +205,7 @@ extern bool lockMainPID(void);
208205
extern void unlockMainPID(void);
209206
extern void parseArguments(int argc, char *argv[]);
210207
extern char *strnstr(const char *s, const char *find, size_t slen);
211-
212-
#ifdef __linux__
213208
extern int lookupAddress (char *, int, int, struct sockaddr *, socklen_t*);
214209

215210
#define IPADDRESS_PRINT_BUFLEN (INET6_ADDRSTRLEN + 16)
216211
extern char *prettyPrintAddress(struct sockaddr*, char*, size_t);
217-
#endif

0 commit comments

Comments
 (0)