From 1e2f3252bd35efd60db338ff786aceae36d3e2ca Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 22 Jul 2021 23:03:15 -0400 Subject: [PATCH] hark! a vagrant! get windows library linking --- CMakeLists.txt | 6 +++--- src/poc/interp.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b922b18d..fd48e1a44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,11 +83,11 @@ set_package_properties(Threads PROPERTIES TYPE REQUIRED) find_package(ZLIB) set_package_properties(ZLIB PROPERTIES TYPE REQUIRED) # platform-specific logics -if(NOT MSYS AND NOT APPLE) +if(MSYS OR WIN32) + set(LIBRT_LIBRARIES wsock32 ws2_32) +elseif(NOT APPLE) find_library(LIBM m REQUIRED) find_library(LIBRT rt REQUIRED) -elseif(MSYS) - find_library(LIBRT ws2_32 REQUIRED) endif() if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") include_directories(/usr/local/include) diff --git a/src/poc/interp.c b/src/poc/interp.c index 493458a61..18c6eb7ac 100644 --- a/src/poc/interp.c +++ b/src/poc/interp.c @@ -8,7 +8,7 @@ interp(struct notcurses* nc, int cellpixy, int cellpixx){ size_t rands = cellpixy * cellpixx * 3; unsigned char* randrgb = malloc(rands); for(size_t r = 0 ; r < rands ; ++r){ - randrgb[r] = random() % 256; + randrgb[r] = rand() % 256; } struct ncvisual* ncv = ncvisual_from_rgb_packed(randrgb, cellpixy, cellpixx * 3, cellpixx, 0xff); if(ncv == NULL){