"comply" with ISO C11

Except for the bunch of macros prefixed with
double underscores, but let's take care of
that some time later (read: never).
This commit is contained in:
anna 2021-07-15 20:59:31 +02:00
parent b011d5feb5
commit 5b46a05ce7
Signed by: fef
GPG key ID: EC22E476DC2D3D84
2 changed files with 5 additions and 1 deletions

View file

@ -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)

View file

@ -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 */ \