BUILD: Fix build with --enable-c++11 on FreeBSD
|Reported by:||(none)||Owned by:||digitall|
On FreeBSD, the definition of NULL depends on the version of the C++ standard used. When building C++03 code, NULL is defined to 0. When building C++11 code, it is defined to nullptr instead. This behaviour is allowed by the standard.
ScummVM has a couple pieces of code, where a null pointer is being cast to an integer type. When building ScummVM as C++03, this works, as it simply yields integer 0. In C++11 mode, this causes the build to fail.
Furthermore, there are several pieces of code in ScummVM that use anonymous structs/unions. This causes Clang to print compiler warnings, as anonymous structs/unions are not part of the standard. This is not addressed by this patch.
Ticket imported from: #3615056. Ticket imported from: bugs/6413.
Change History (5)
comment:3 by , 9 years ago
|Status:||new → closed|
|Summary:||Fix build with --enable-c++11 on FreeBSD → BUILD: Fix build with --enable-c++11 on FreeBSD|