Unbreak build with gcc-4.2.1

Noticed by and ok naddy@
This commit is contained in:
bcallah 2018-04-28 18:10:04 +00:00
parent e0a14dcf81
commit f5e7bcdd72
7 changed files with 152 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.19 2018/04/08 19:16:43 bcallah Exp $
# $OpenBSD: Makefile,v 1.20 2018/04/28 18:10:04 bcallah Exp $
COMMENT = free J-RPG game
CATEGORIES = games x11
@ -38,8 +38,7 @@ RUN_DEPENDS = devel/desktop-file-utils \
# PCH (Precompiled Headers) are known to be broken so disable
# the use of PCH.
CONFIGURE_ARGS+= -DUSE_PCH_COMPILATION=Off \
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -std=c++03"
CONFIGURE_ARGS+= -DUSE_PCH_COMPILATION=Off
WRKDIST = ${WRKDIR}/ValyriaTear-${GH_TAGNAME}

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-src_common_options_handler_cpp,v 1.1 2018/04/28 18:10:04 bcallah Exp $
clang6 fix
Index: src/common/options_handler.cpp
--- src/common/options_handler.cpp.orig
+++ src/common/options_handler.cpp
@@ -618,7 +618,7 @@ void GameOptionsMenuHandler::_RefreshLanguageOptions()
_language_options_menu.SetSelection(0);
if (warnAboutMissingFiles) {
- std::string mo_filename = lang + "/LC_MESSAGES/"APPSHORTNAME".mo";
+ std::string mo_filename = lang + "/LC_MESSAGES/" APPSHORTNAME ".mo";
PRINT_WARNING << "Couldn't locate gettext .mo file: '" << mo_filename << "'." << std::endl
<< "The " << lang << " translation will be disabled." << std::endl;
}

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-src_engine_system_cpp,v 1.1 2018/04/28 18:10:04 bcallah Exp $
clang6 fix
Index: src/engine/system.cpp
--- src/engine/system.cpp.orig
+++ src/engine/system.cpp
@@ -351,7 +351,7 @@ bool SystemEngine::IsLanguageAvailable(const std::stri
std::string mo_filename = _Reinitl10n();
mo_filename.append("/");
mo_filename.append(lang);
- mo_filename.append("/LC_MESSAGES/"APPSHORTNAME".mo");
+ mo_filename.append("/LC_MESSAGES/" APPSHORTNAME ".mo");
// Note: English is always available as it's the default language
if (lang == "en@quot")

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-src_engine_video_video_cpp,v 1.1 2018/04/28 18:10:04 bcallah Exp $
clang6 fix
Index: src/engine/video/video.cpp
--- src/engine/video/video.cpp.orig
+++ src/engine/video/video.cpp
@@ -434,7 +434,7 @@ bool VideoEngine::ApplySettings()
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
- if(SDL_SetVideoMode(_temp_width, _temp_height, 0, flags) == false) {
+ if(SDL_SetVideoMode(_temp_width, _temp_height, 0, flags) == NULL) {
// RGB values of 1 for each and 8 for depth seemed to be sufficient.
// 565 and 16 here because it works with them on this computer.
// NOTE from prophile: this ought to be changed to 5558
@@ -447,7 +447,7 @@ bool VideoEngine::ApplySettings()
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
- if(SDL_SetVideoMode(_temp_width, _temp_height, 0, flags) == false) {
+ if(SDL_SetVideoMode(_temp_width, _temp_height, 0, flags) == NULL) {
IF_PRINT_WARNING(VIDEO_DEBUG) << "SDL_SetVideoMode() failed with error: " << SDL_GetError() << std::endl;
_temp_fullscreen = _fullscreen;

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-src_main_cpp,v 1.3 2018/04/28 18:10:04 bcallah Exp $
clang6 fix
Index: src/main.cpp
--- src/main.cpp.orig
+++ src/main.cpp
@@ -459,7 +459,7 @@ int main(int argc, char *argv[])
chdir(path.c_str());
#elif (defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(SOLARIS)) && !defined(RELEASE_BUILD)
// Look for data files in DATADIR only if they are not available in the current directory.
- if(std::ifstream("dat/config/settings.lua") == NULL) {
+ if(!std::ifstream("dat/config/settings.lua")) {
if(chdir(PKG_DATADIR) != 0) {
throw Exception("ERROR: failed to change directory to data location", __FILE__, __LINE__, __FUNCTION__);
}

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-src_main_options_cpp,v 1.1 2018/04/28 18:10:04 bcallah Exp $
clang6 fix
Index: src/main_options.cpp
--- src/main_options.cpp.orig
+++ src/main_options.cpp
@@ -147,7 +147,7 @@ bool ParseSecondaryOptions(const std::string &vars, st
void PrintUsage()
{
std::cout
- << "usage: "APPSHORTNAME" [options]" << std::endl
+ << "usage: " APPSHORTNAME " [options]" << std::endl
<< " --check/-c :: checks all files for integrity" << std::endl
<< " --debug/-d <args> :: enables debug statements in specified sections of the" << std::endl
<< " program, where <args> can be:" << std::endl

View File

@ -0,0 +1,61 @@
$OpenBSD: patch-src_utils_utils_files_cpp,v 1.1 2018/04/28 18:10:04 bcallah Exp $
clang6 fixes
Index: src/utils/utils_files.cpp
--- src/utils/utils_files.cpp.orig
+++ src/utils/utils_files.cpp
@@ -279,7 +279,7 @@ static void _CopyOldSaveFiles(const std::string &desti
if(!pw)
return;
- std::string old_path = std::string(pw->pw_dir) + "/."APPSHORTNAME"/";
+ std::string old_path = std::string(pw->pw_dir) + "/." APPSHORTNAME "/";
if(!DoesFileExist(old_path))
return; // Nothing to do.
#elif defined _WIN32
@@ -330,7 +330,7 @@ static void _CopyOldSettingsFile(const std::string &de
if(!pw)
return; // Nothing to do
- std::string old_file = std::string(pw->pw_dir) + "/."APPSHORTNAME"/settings.lua";
+ std::string old_file = std::string(pw->pw_dir) + "/." APPSHORTNAME "/settings.lua";
if(!DoesFileExist(old_file))
return; // Nothing to do.
@@ -387,7 +387,7 @@ static const std::string _SetupUserDataPath()
// $XDG_DATA_HOME/valyriatear/
// equals to: ~/.local/share/valyriatear/ most of the time
if (getenv("XDG_DATA_HOME")) {
- std::string path = std::string(getenv("XDG_DATA_HOME")) + "/"APPSHORTNAME"/";
+ std::string path = std::string(getenv("XDG_DATA_HOME")) + "/" APPSHORTNAME "/";
if(!DoesFileExist(path))
MakeDirectory(path);
_CopyOldSaveFiles(path);
@@ -403,7 +403,7 @@ static const std::string _SetupUserDataPath()
path += "/share/";
if(!DoesFileExist(path))
MakeDirectory(path);
- path += "/"APPSHORTNAME"/";
+ path += "/" APPSHORTNAME "/";
if(!DoesFileExist(path))
MakeDirectory(path);
_CopyOldSaveFiles(path);
@@ -448,7 +448,7 @@ static const std::string _SetupUserConfigPath()
// $XDG_CONFIG_HOME/valyriatear/
// equals to: ~/.config/valyriatear/ most of the time
if (getenv("XDG_CONFIG_HOME")) {
- std::string path = std::string(getenv("XDG_CONFIG_HOME")) + "/"APPSHORTNAME"/";
+ std::string path = std::string(getenv("XDG_CONFIG_HOME")) + "/" APPSHORTNAME "/";
if(!DoesFileExist(path))
MakeDirectory(path);
_CopyOldSettingsFile(path);
@@ -462,7 +462,7 @@ static const std::string _SetupUserConfigPath()
std::string path = std::string(pw->pw_dir) + "/.config/";
if(!DoesFileExist(path))
MakeDirectory(path);
- path += "/"APPSHORTNAME"/";
+ path += "/" APPSHORTNAME "/";
if(!DoesFileExist(path))
MakeDirectory(path);
_CopyOldSettingsFile(path);