From 99a653db5f45a5284e24ef5d34935e31eb7739e0 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 16 Aug 2021 00:23:33 -0400 Subject: [PATCH] shuffle up ncport.h to restore Hurd --- include/notcurses/ncport.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/notcurses/ncport.h b/include/notcurses/ncport.h index c84a9f2e7..c7ba1d11b 100644 --- a/include/notcurses/ncport.h +++ b/include/notcurses/ncport.h @@ -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 #include #include #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 #define htole(x) (__bswap_32(htonl(x))) #elif defined(__APPLE__) // macOS #include #define htole(x) (OSSwapInt32(htonl(x))) -#else // BSD +#elif defined(__gnu_hurd__) // Hurd +#include +#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 #define htole(x) (bswap32(htonl(x))) #endif