Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -16,11 +16,10 @@ #include "config.h" #include #include -#include #import "OFURL.h" #import "OFString.h" #import "OFArray.h" #import "OFXMLElement.h" @@ -135,11 +134,11 @@ if ([_scheme isEqual: @"http"]) _port = 80; else if ([_scheme isEqual: @"https"]) _port = 443; else - assert(0); + OF_ENSURE(0); } if ((UTF8String = tmp) != NULL) { if ((tmp = strchr(UTF8String, '#')) != NULL) { *tmp = '\0'; Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -110,10 +110,19 @@ if (!(cond)) { \ fprintf(stderr, "Failed to ensure condition in " \ __FILE__ ":%d:\n" #cond "\n", __LINE__); \ abort(); \ } + +#if __STDC_VERSION__ >= 201112L +# /* C11 compiler, but old libc */ +# ifndef static_assert +# define static_assert _Static_assert +# endif +#else +# define static_assert assert +#endif #if !defined(_WIN32) && !defined(__DJGPP__) # define OF_PATH_DELIMITER '/' # define OF_PATH_DELIMITER_STRING @"/" # define OF_IS_PATH_DELIMITER(c) (c == '/')