Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
e7aaeec5
Commit
e7aaeec5
authored
Feb 20, 2011
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a revision number for easy compile-time tests.
parent
d5af47a5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
4 deletions
+26
-4
updaterev.sh
build-scripts/updaterev.sh
+2
-0
SDL_revision.h
include/SDL_revision.h
+1
-0
SDL_version.h
include/SDL_version.h
+10
-0
SDL.c
src/SDL.c
+7
-0
testver.c
test/testver.c
+6
-4
No files found.
build-scripts/updaterev.sh
View file @
e7aaeec5
...
...
@@ -9,7 +9,9 @@ header=$outdir/include/SDL_revision.h
rev
=
`
sh showrev.sh 2>/dev/null
`
if
[
"
$rev
"
!=
""
-a
"
$rev
"
!=
"hg-0:baadf00d"
]
;
then
revnum
=
`
echo
$rev
|
sed
's,hg-\([0-9]*\).*,\1,'
`
echo
"#define SDL_REVISION
\"
$rev
\"
"
>
$header
.new
echo
"#define SDL_REVISION_NUMBER
$revnum
"
>>
$header
.new
if
diff
$header
$header
.new
>
/dev/null 2>&1
;
then
rm
$header
.new
else
...
...
include/SDL_revision.h
View file @
e7aaeec5
#define SDL_REVISION "hg-0:aaaaaaaaaaah"
#define SDL_REVISION_NUMBER 0
include/SDL_version.h
View file @
e7aaeec5
...
...
@@ -144,6 +144,16 @@ extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
*/
extern
DECLSPEC
const
char
*
SDLCALL
SDL_GetRevision
(
void
);
/**
* \brief Get the revision number of SDL that is linked against your program.
*
* Returns a number uniquely identifying the exact revision of the SDL
* library in use. It is an incrementing number based on commits to
* hg.libsdl.org.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetRevisionNumber
(
void
);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
...
...
src/SDL.c
View file @
e7aaeec5
...
...
@@ -236,6 +236,13 @@ SDL_GetRevision(void)
return
SDL_REVISION
;
}
/* Get the library source revision number */
int
SDL_GetRevisionNumber
(
void
)
{
return
SDL_REVISION_NUMBER
;
}
/* Get the name of the platform */
const
char
*
SDL_GetPlatform
()
...
...
test/testver.c
View file @
e7aaeec5
...
...
@@ -21,11 +21,13 @@ main(int argc, char *argv[])
printf
(
"Compiled with SDL older than 1.3
\n
"
);
#endif
SDL_VERSION
(
&
compiled
);
printf
(
"Compiled version: %d.%d.%d (%s)
\n
"
,
compiled
.
major
,
compiled
.
minor
,
compiled
.
patch
,
SDL_REVISION
);
printf
(
"Compiled version: %d.%d.%d.%d (%s)
\n
"
,
compiled
.
major
,
compiled
.
minor
,
compiled
.
patch
,
SDL_REVISION_NUMBER
,
SDL_REVISION
);
SDL_GetVersion
(
&
linked
);
printf
(
"Linked version: %d.%d.%d (%s)
\n
"
,
linked
.
major
,
linked
.
minor
,
linked
.
patch
,
SDL_GetRevision
());
printf
(
"Linked version: %d.%d.%d.%d (%s)
\n
"
,
linked
.
major
,
linked
.
minor
,
linked
.
patch
,
SDL_GetRevisionNumber
(),
SDL_GetRevision
());
SDL_Quit
();
return
(
0
);
}
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