From fc02537d59b996b581beb5fc977f2bf015b4b307 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Wed, 25 Jul 2018 15:30:42 -0700 Subject: [PATCH] [emscripten] Use long instead of int for ssize_t (#880) This was recently changed in emscripten. It seems that ssize_t can be used directly now, so defining it is only necessary for MSVC. --- CMakeLists.txt | 11 +++-------- src/config.h.in | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d7f87272..995eb6fde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,14 +61,9 @@ if (WIN32) check_symbol_exists(ENABLE_VIRTUAL_TERMINAL_PROCESSING "windows.h" HAVE_WIN32_VT100) endif () -if (EMSCRIPTEN) - set(SIZEOF_SSIZE_T 4) - set(SIZEOF_SIZE_T 4) -else () - include(CheckTypeSize) - check_type_size(ssize_t SSIZE_T) - check_type_size(size_t SIZEOF_SIZE_T) -endif () +include(CheckTypeSize) +check_type_size(ssize_t SSIZE_T) +check_type_size(size_t SIZEOF_SIZE_T) configure_file( ${WABT_SOURCE_DIR}/src/config.h.in diff --git a/src/config.h.in b/src/config.h.in index e7c800a4c..9cff0b40a 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -279,7 +279,7 @@ int wabt_vsnprintf(char* str, size_t size, const char* format, va_list ap); #endif #if !HAVE_SSIZE_T -typedef int ssize_t; +typedef long ssize_t; #endif #if !HAVE_STRCASECMP