Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
libretro-chailove
Commits
3ab6b772
Verified
Commit
3ab6b772
authored
Aug 17, 2019
by
RobLoach
Browse files
Remove semver check
parent
00177165
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitmodules
View file @
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
...
...
Makefile.common
View file @
3ab6b772
...
...
@@ -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
...
...
src/love/system.cpp
View file @
3ab6b772
...
...
@@ -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
;
}
...
...
semver
@
b57cf092
Compare
b57cf092
...
b57cf092
Subproject commit b57cf0923bc6cd1c493cfcfe353cac38dc82932e
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment