Unverified Commit 0971a74e authored by RobLoach's avatar RobLoach Committed by GitHub
Browse files

Merge pull request #373 from libretro/semver

Remove semver check
parents 00177165 3ab6b772
......@@ -53,11 +53,6 @@
url = https://github.com/effolkronium/random.git
ignore = dirty
branch = master
[submodule "vendor/semver"]
path = vendor/semver
url = https://github.com/h2non/semver.c.git
ignore = dirty
branch = master
[submodule "vendor/TinySHA1"]
path = vendor/TinySHA1
url = https://github.com/mohaps/TinySHA1.git
......
......@@ -10,10 +10,6 @@ SOURCES_CXX := $(wildcard \
)
FLAGS += -Wfatal-errors
# semver
FLAGS += -I$(CORE_DIR)/vendor/semver
SOURCES_C := $(CORE_DIR)/vendor/semver/semver.c
# random
FLAGS += -I$(CORE_DIR)/vendor/random/include
......
......@@ -6,7 +6,6 @@
#include <iostream>
#include <cstdio>
#include <vector>
#include "semver.h"
#include "libretro.h"
namespace love {
......@@ -91,53 +90,7 @@ bool system::load(config& t) {
// Ensure we retrieve the latest variable states.
updateVariables(t);
// Load the semantic version string.
semver_t chailoveVersion = {};
semver_t coreVersion = {};
bool showWarning = false;
if (semver_parse(getVersionString().c_str(), &chailoveVersion)
|| semver_parse(t.version.c_str(), &coreVersion)) {
std::cout << "[ChaiLove] [system] Error: Invalid t.version string " << t.version << std::endl;
return true;
}
std::cout << "[ChaiLove] [system] Version current: " << getVersionString() << std::endl;
std::cout << "[ChaiLove] [system] Version targeted: " << t.version << std::endl;
// Compare the version to the version of ChaiLove.
int resolution = semver_compare(coreVersion, chailoveVersion);
if (resolution == 0) {
std::cout << "[ChaiLove] [system] Version " << getVersionString() << " == " << t.version << std::endl;
} else if (resolution == -1) {
std::cout << "[ChaiLove] [system] Version " << getVersionString() << " > " << t.version << std::endl;
} else {
std::cout << "[ChaiLove] [system] Version " << getVersionString() << " < " << t.version << std::endl;
}
// Check the ~= satisfaction
resolution = semver_satisfies(chailoveVersion, coreVersion, "~");
if (resolution == 1) {
std::cout << "[ChaiLove] [system] Version " << getVersionString() << " ~= " << t.version << std::endl;
} else {
std::cout << "[ChaiLove] [system] Version " << getVersionString() << " !~= " << t.version << std::endl;
}
// Check the ^= satisfaction
resolution = semver_satisfies(chailoveVersion, coreVersion, "^");
if (resolution == 1) {
std::cout << "[ChaiLove] [system] Version " << getVersionString() << " ^= " << t.version << std::endl;
} else {
std::cout << "[ChaiLove] [system] Version " << getVersionString() << " !^= " << t.version << std::endl;
showWarning = true;
}
// Display a warning in the On-Screen Display.
if (showWarning) {
std::string message = "Warning: Expected ChaiLove " + t.version + ", running " + getVersionString();
std::cout << "[ChaiLove] [system] " << message << std::endl;
ChaiLove::getInstance()->window.showMessageBox(message);
}
// Loading success.
return true;
}
......
Subproject commit b57cf0923bc6cd1c493cfcfe353cac38dc82932e
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment