Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions net/src/net_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@

#include "eos/net.h"

/* eos/net.h puts every eNet declaration behind EOS_ENABLE_NET, but this
* file is in eos_net's source list unconditionally. Built without the
* feature -- which is the default configuration, since CMakeLists.txt only
* defines EOS_ENABLE_NET for the test build -- the header contributed no
* types and every definition below failed with "unknown type name
* eos_socket_t". Guarding the body compiles it away instead, which is what
* a disabled feature is supposed to do. */
#if EOS_ENABLE_NET

#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
Expand Down Expand Up @@ -203,3 +212,5 @@ int eos_net_resolve(const char *hostname, uint32_t *ip)
freeaddrinfo(res);
return 0;
}

#endif /* EOS_ENABLE_NET */
1 change: 1 addition & 0 deletions tests/test_net.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: MIT
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
Loading