Skip to content
Open
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
12 changes: 12 additions & 0 deletions libs/common/osdef.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
# define OS_BSD
#endif

#if defined(__FreeBSD__)
# define OS_FREEBSD
#endif

#if defined(__NetBSD__)
# define OS_NETBSD
#endif

#if defined(__OpenBSD__)
# define OS_OPENBSD
#endif

#if defined(__GNU__)
# define OS_HURD
#endif
Expand Down
3 changes: 2 additions & 1 deletion libs/common/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ PHOST phost_resolve( const char *host ) {
PHOST ip = inet_addr(host);
if( ip == INADDR_NONE ) {
struct hostent *h;
# if defined(OS_WINDOWS) || defined(OS_MAC) || defined(OS_CYGWIN) || defined(__NetBSD__) || defined(__OpenBSD__)
# if defined(OS_WINDOWS) || defined(OS_MAC) || defined(OS_CYGWIN) || \
defined(OS_NETBSD) || defined(OS_OPENBSD)
h = gethostbyname(host);
# else
struct hostent hbase;
Expand Down
3 changes: 2 additions & 1 deletion libs/std/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ static value host_resolve( value host ) {
ip = inet_addr(val_string(host));
if( ip == INADDR_NONE ) {
struct hostent *h;
# if defined(NEKO_WINDOWS) || defined(NEKO_MAC) || defined(NEKO_CYGWIN) || defined(__NetBSD__) || defined(__OpenBSD__)
# if defined(NEKO_WINDOWS) || defined(NEKO_MAC) || defined(NEKO_CYGWIN) || \
defined(NEKO_NETBSD) || defined(NEKO_OPENBSD)
h = gethostbyname(val_string(host));
# else
struct hostent hbase;
Expand Down
2 changes: 1 addition & 1 deletion vm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static char *executable_path() {
sysctl(mib, 4, path, &cb, NULL, 0);
if (!cb) return NULL;
return path;
#elif defined(__OpenBSD__) && defined(HAVE_GETEXECPATH)
#elif defined(NEKO_OPENBSD) && defined(HAVE_GETEXECPATH)
static char path[PATH_MAX];
if (getexecpath(path, sizeof(path)) == -1)
return NULL;
Expand Down
12 changes: 12 additions & 0 deletions vm/neko.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@
# define NEKO_BSD
#endif

#if defined(__FreeBSD__)
# define NEKO_FREEBSD
#endif

#if defined(__NetBSD__)
# define NEKO_NETBSD
#endif

#if defined(__OpenBSD__)
# define NEKO_OPENBSD
#endif

#if defined(__GNU__)
# define NEKO_HURD
#endif
Expand Down