shuffle up ncport.h to restore Hurd

pull/2083/head
nick black 3 years ago
parent d00a96d850
commit 99a653db5f
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -10,28 +10,28 @@ extern "C" {
// 32-bit values to little-endian (as used in the nccell gcluster field). This
// ought be defined so that it's a a no-op on little-endian builds.
#if defined(__MINGW64__) // Windows
#define wcwidth(w) 1 // FIXME lol, no
#define wcswidth(w, s) (s) // FIXME lol, no
#define htole(x) (x) // FIXME are all windows installs LE? ugh
#else // Non-Windows, UNIX-common
#ifndef(__MINGW64__) // All but Windows
#include <poll.h>
#include <netinet/in.h>
#include <termios.h>
#endif
#if defined(__gnu_hurd__) // Hurd
#define wcwidth(w) 1 // FIXME lol, no
#define wcswidth(w, s) (s) // FIXME lol, no
#endif
#if defined(__linux__) || defined(__gnu_hurd__) // Linux/Hurd
#if defined(__linux__) // Linux
#include <byteswap.h>
#define htole(x) (__bswap_32(htonl(x)))
#elif defined(__APPLE__) // macOS
#include <libkern/OSByteOrder.h>
#define htole(x) (OSSwapInt32(htonl(x)))
#else // BSD
#elif defined(__gnu_hurd__) // Hurd
#include <byteswap.h>
#define htole(x) (__bswap_32(htonl(x)))
#define wcwidth(w) 1 // FIXME lol, no
#define wcswidth(w, s) (s) // FIXME lol, no
#elif defined(__MINGW64__) // Windows
#define wcwidth(w) 1 // FIXME lol, no
#define wcswidth(w, s) (s) // FIXME lol, no
#define htole(x) (x) // FIXME are all windows installs LE? ugh
#else // BSDs
#include <sys/endian.h>
#define htole(x) (bswap32(htonl(x)))
#endif

Loading…
Cancel
Save