diff options
| author | Peter0x44 <[email protected]> | 2023-06-01 08:47:52 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-06-01 09:47:52 +0200 |
| commit | 2dec56e7b772ce4734f415e03715d0712ae68b8a (patch) | |
| tree | 1cbddc6855ae8366da9cff553ab18baadcde62d3 /projects/Notepad++/raylib_npp_parser/raylib_npp.xml | |
| parent | e497603678823dc93f01dd9686819a92d780ad67 (diff) | |
| download | raylib-2dec56e7b772ce4734f415e03715d0712ae68b8a.tar.gz raylib-2dec56e7b772ce4734f415e03715d0712ae68b8a.zip | |
Add error if raylib.h is included in a C++98 program (#3093)
The color macros don't work properly in C++98, because they require
aggregate initialzation, which is a C++11 feature. So, explicitly state
how to fix this issue, instead of letting the compiler give a more vague
error message like:
main.cpp:8:23: error: expected '(' for function-style cast or type construction
ClearBackground(BLACK);
^~~~~
/opt/homebrew/Cellar/raylib/4.5.0/include/raylib.h:179:35: note: expanded from macro 'BLACK'
#define BLACK CLITERAL(Color){ 0, 0, 0, 255 } // Black
NOTE: Don't use this check with MSVC because by default, it reports
199711L regardless of any C++ version passed on command line
Only passing `/Zc:__cplusplus` will make MSVC set this correctly
see: https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus
Diffstat (limited to 'projects/Notepad++/raylib_npp_parser/raylib_npp.xml')
0 files changed, 0 insertions, 0 deletions
