/** \file net.c Networking-related helper functions. */
-/*
- * Since glibc 2.8, the _GNU_SOURCE feature test macro must be defined in order
- * to obtain the definition of the ucred structure.
- */
-#define _GNU_SOURCE
+#include "para.h"
#include <netinet/in.h>
#include <arpa/inet.h>
#include <regex.h>
-#include "para.h"
#include "error.h"
#include "net.h"
#include "string.h"
}
if (*o == ':')
- if (para_atoi32(++o, port) < 0 ||
- *port < 0 || *port > 0xffff)
+ if (para_atoi32(++o, port) < 0 || *port < 0 || *port > 0xffff)
goto failed;
if (host_string_ok(host))
return host;
/**
* Stringify port number, resolve into service name where defined.
+ *
* \param port 2-byte port number, in host-byte-order.
* \param transport Transport protocol name (e.g. "udp", "tcp"), or NULL.
* \return Pointer to static result buffer.