Windows: kill some warnings

This commit is contained in:
nick black 2021-08-26 05:36:43 -04:00
parent 321f9ecbe2
commit ba030a3293
3 changed files with 7 additions and 8 deletions

View File

@ -27,11 +27,11 @@ extern "C" {
#include <byteswap.h>
#define htole(x) (__bswap_32(htonl(x)))
#define wcwidth(w) 1 // FIXME lol, no
#define wcswidth(w, s) (wcslen(w)) // FIXME lol, no
#define wcswidth(w, s) (int)(wcslen(w)) // FIXME lol, no
#elif defined(__MINGW64__) // Windows
#include <string.h>
#define wcwidth(w) 1 // FIXME lol, no
#define wcswidth(w, s) (wcslen(w)) // FIXME lol, no
#define wcswidth(w, s) (int)(wcslen(w)) // FIXME lol, no
#define htole(x) (x) // FIXME are all windows installs LE? ugh
#else // BSDs
#include <sys/endian.h>

View File

@ -14,7 +14,6 @@
#include <sys/sysctl.h>
#include <sys/utsname.h>
#else
#include <windows.h>
#include <sysinfoapi.h>
#endif
#include <notcurses/notcurses.h>

View File

@ -81,8 +81,8 @@ int main(int argc, char **argv){
fflush(stdout);
ncdirect_cursor_yx(n, &newy, &newx);
int realcols = (newx - x) + ncdirect_dim_x(n) * (newy - y);
printf("\n iterated wcwidth: %d total bytes: %zu wcswidth: %d true width: %d\n\n",
totalcols, totalb, wcswidth(wbuf, used), realcols);
printf("\n iterated wcwidth: %d total bytes: %llu wcswidth: %d true width: %d\n\n",
totalcols, (unsigned long long)totalb, wcswidth(wbuf, used), realcols);
ncdirect_cursor_yx(n, &y, &x);
// throw up a background color for invisible glyphs
uint64_t chan = NCCHANNELS_INITIALIZER(0xff, 0xff, 0xff, 0, 0x80, 0);