diff --git a/CMakeLists.txt b/CMakeLists.txt index 51db36f..64348be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14.0) project(neo VERSION 0.1.0 LANGUAGES C) set(CMAKE_C_STANDARD 11) -set(CMAKE_C_EXTENSIONS ON) +set(CMAKE_C_EXTENSIONS OFF) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) set_property(GLOBAL PROPERTY USE_FOLDERS ON) diff --git a/include/neo/_stddef.h b/include/neo/_stddef.h index 8ee59fe..c5114be 100644 --- a/include/neo/_stddef.h +++ b/include/neo/_stddef.h @@ -21,6 +21,10 @@ extern "C" { # define offsetof(type, member) __builtin_offsetof(type, member) #endif +#ifndef typeof +# define typeof(expr) __typeof(expr) +#endif + /** Get the absolute (non negative) value of an integer */ #define nabs(n) ({ \ /* n is an expression, not a variable, evaluate it only once */ \