I am having trouble getting clang into a C++/98 mode, can someone help me with that?
1.) No uint32_t in c++/98
// Are this the correct includes for uint32_t and size_t ?
#include <stdint.h> // uint64_t, uint32_t, uint8_t, int16_t, etc.
#include <stdlib.h> // size_t
#include <limits.h> // UINT32_MAX
/*
..\final_platform_layer.hpp:1646:11: error: unknown type name 'uint32_t'; did you mean 'int32_t'?
fpl_api uint32_t ReadFileBlock32(const FileHandle &fileHandle, const uint32_t sizeToRead, void *targetBuffer, const uint32_t maxTargetBufferSize);
*/
2.) Macro is expanded always - even though __cplusplus should not be greater than 199711...
#if (__cplusplus >= 201103L) || (_MSC_VER >= 1900)
//! Null pointer (nullptr)
# define fpl_null nullptr
//! Constant (constexpr)
# define fpl_constant constexpr
#else
//! Null pointer (0)
# define fpl_null 0
//! Constant (static const)
# define fpl_constant static const
#endif
/*
In file included from FPL_Console\main.cpp:13:
..\final_platform_layer.hpp:1623:4: error: unknown type name 'constexpr'
fpl_constant uint32_t MAX_FILEENTRY_PATH_LENGTH = 1024;
*/
I am compiling like this (Win32):
set BUILD_DIR=bin\FPL_Console\x64-Debug
set IGNORED_WARNINGS=-Wno-missing-field-initializers -Wno-sign-conversion -Wno-cast-qual -Wno-unused-parameter -Wno-format-nonliteral -Wno-old-style-cast -Wno-header-hygiene
rmdir /s /q %BUILD_DIR%
mkdir %BUILD_DIR%
clang -g -Weverything %IGNORED_WARNINGS% -DFPL_DEBUG -std=c++98 -O0 -I..\ -lkernel32.lib -o%BUILD_DIR%\FPL_Console.exe FPL_Console\main.cpp > error.txt 2>&1