Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lactozilla
SRB2
Commits
6dcdb8d9
Commit
6dcdb8d9
authored
Dec 12, 2019
by
James R.
Browse files
Options
Downloads
Patches
Plain Diff
Move everything to i_system.c
This also simplifies things; SDL isn't initialized in the parent process.
parent
7c383e4a
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/doomdef.h
+0
-4
0 additions, 4 deletions
src/doomdef.h
src/i_system.h
+0
-4
0 additions, 4 deletions
src/i_system.h
src/sdl/i_main.c
+0
-51
0 additions, 51 deletions
src/sdl/i_main.c
src/sdl/i_system.c
+57
-1
57 additions, 1 deletion
src/sdl/i_system.c
with
57 additions
and
60 deletions
src/doomdef.h
+
0
−
4
View file @
6dcdb8d9
...
@@ -125,10 +125,6 @@
...
@@ -125,10 +125,6 @@
#define LOGMESSAGES // write message in log.txt
#define LOGMESSAGES // write message in log.txt
#endif
#endif
#if (defined (__unix__) && !defined (_MSDOS)) || defined (UNIXCOMMON)
#define NEWSIGNALHANDLER
#endif
#ifdef LOGMESSAGES
#ifdef LOGMESSAGES
extern
FILE
*
logstream
;
extern
FILE
*
logstream
;
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
src/i_system.h
+
0
−
4
View file @
6dcdb8d9
...
@@ -84,10 +84,6 @@ ticcmd_t *I_BaseTiccmd2(void);
...
@@ -84,10 +84,6 @@ ticcmd_t *I_BaseTiccmd2(void);
*/
*/
void
I_Quit
(
void
)
FUNCNORETURN
;
void
I_Quit
(
void
)
FUNCNORETURN
;
/** \brief Print a message and text box about a signal that was raised.
*/
void
I_ReportSignal
(
int
num
,
int
coredumped
);
typedef
enum
typedef
enum
{
{
EvilForce
=
-
1
,
EvilForce
=
-
1
,
...
...
This diff is collapsed.
Click to expand it.
src/sdl/i_main.c
+
0
−
51
View file @
6dcdb8d9
...
@@ -28,11 +28,6 @@
...
@@ -28,11 +28,6 @@
#include
"time.h"
// For log timestamps
#include
"time.h"
// For log timestamps
#ifdef NEWSIGNALHANDLER
#include
<errno.h>
#include
<sys/wait.h>
#endif
#ifdef HAVE_SDL
#ifdef HAVE_SDL
#ifdef HAVE_TTF
#ifdef HAVE_TTF
...
@@ -187,52 +182,6 @@ int main(int argc, char **argv)
...
@@ -187,52 +182,6 @@ int main(int argc, char **argv)
MakeCodeWritable
();
MakeCodeWritable
();
#endif
#endif
#ifdef NEWSIGNALHANDLER
switch
(
fork
())
{
case
-
1
:
I_Error
(
"Error setting up signal reporting: fork(): %s
\n
"
,
strerror
(
errno
)
);
break
;
case
0
:
break
;
default:
{
int
status
;
int
signum
;
if
(
wait
(
&
status
)
==
-
1
)
{
I_Error
(
"Error setting up signal reporting: fork(): %s
\n
"
,
strerror
(
errno
)
);
}
else
{
if
(
WIFSIGNALED
(
status
))
{
signum
=
WTERMSIG
(
status
);
#ifdef WCOREDUMP
I_ReportSignal
(
signum
,
WCOREDUMP
(
status
));
#else
I_ReportSignal
(
signum
,
0
);
#endif
status
=
128
+
signum
;
}
else
if
(
WIFEXITED
(
status
))
{
status
=
WEXITSTATUS
(
status
);
}
I_ShutdownSystem
();
exit
(
status
);
}
}
}
#endif
/*NEWSIGNALHANDLER*/
// startup SRB2
// startup SRB2
CONS_Printf
(
"Setting up SRB2...
\n
"
);
CONS_Printf
(
"Setting up SRB2...
\n
"
);
D_SRB2Main
();
D_SRB2Main
();
...
...
This diff is collapsed.
Click to expand it.
src/sdl/i_system.c
+
57
−
1
View file @
6dcdb8d9
...
@@ -102,6 +102,12 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
...
@@ -102,6 +102,12 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T);
#endif
#endif
#endif
#endif
#if (defined (__unix__) && !defined (_MSDOS)) || defined (UNIXCOMMON)
#include
<errno.h>
#include
<sys/wait.h>
#define NEWSIGNALHANDLER
#endif
#ifndef NOMUMBLE
#ifndef NOMUMBLE
#ifdef __linux__ // need -lrt
#ifdef __linux__ // need -lrt
#include
<sys/mman.h>
#include
<sys/mman.h>
...
@@ -229,7 +235,7 @@ SDL_bool framebuffer = SDL_FALSE;
...
@@ -229,7 +235,7 @@ SDL_bool framebuffer = SDL_FALSE;
UINT8
keyboard_started
=
false
;
UINT8
keyboard_started
=
false
;
void
I_ReportSignal
(
int
num
,
int
coredumped
)
static
void
I_ReportSignal
(
int
num
,
int
coredumped
)
{
{
//static char msg[] = "oh no! back to reality!\r\n";
//static char msg[] = "oh no! back to reality!\r\n";
const
char
*
sigmsg
;
const
char
*
sigmsg
;
...
@@ -2160,6 +2166,53 @@ void I_Sleep(void)
...
@@ -2160,6 +2166,53 @@ void I_Sleep(void)
SDL_Delay
(
cv_sleep
.
value
);
SDL_Delay
(
cv_sleep
.
value
);
}
}
#ifdef NEWSIGNALHANDLER
static
void
I_Fork
(
void
)
{
int
status
;
int
signum
;
switch
(
fork
())
{
case
-
1
:
I_Error
(
"Error setting up signal reporting: fork(): %s
\n
"
,
strerror
(
errno
)
);
break
;
case
0
:
break
;
default:
if
(
wait
(
&
status
))
{
I_Error
(
"Error setting up signal reporting: fork(): %s
\n
"
,
strerror
(
errno
)
);
}
else
{
if
(
WIFSIGNALED
(
status
))
{
signum
=
WTERMSIG
(
status
);
#ifdef WCOREDUMP
I_ReportSignal
(
signum
,
WCOREDUMP
(
status
));
#else
I_ReportSignal
(
signum
,
0
);
#endif
status
=
128
+
signum
;
}
else
if
(
WIFEXITED
(
status
))
{
status
=
WEXITSTATUS
(
status
);
}
I_ShutdownSystem
();
exit
(
status
);
}
}
}
#endif
/*NEWSIGNALHANDLER*/
INT32
I_StartupSystem
(
void
)
INT32
I_StartupSystem
(
void
)
{
{
SDL_version
SDLcompiled
;
SDL_version
SDLcompiled
;
...
@@ -2167,6 +2220,9 @@ INT32 I_StartupSystem(void)
...
@@ -2167,6 +2220,9 @@ INT32 I_StartupSystem(void)
SDL_VERSION
(
&
SDLcompiled
)
SDL_VERSION
(
&
SDLcompiled
)
SDL_GetVersion
(
&
SDLlinked
);
SDL_GetVersion
(
&
SDLlinked
);
I_StartupConsole
();
I_StartupConsole
();
#ifdef NEWSIGNALHANDLER
I_Fork
();
#endif
I_OutputMsg
(
"Compiled for SDL version: %d.%d.%d
\n
"
,
I_OutputMsg
(
"Compiled for SDL version: %d.%d.%d
\n
"
,
SDLcompiled
.
major
,
SDLcompiled
.
minor
,
SDLcompiled
.
patch
);
SDLcompiled
.
major
,
SDLcompiled
.
minor
,
SDLcompiled
.
patch
);
I_OutputMsg
(
"Linked with SDL version: %d.%d.%d
\n
"
,
I_OutputMsg
(
"Linked with SDL version: %d.%d.%d
\n
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment