Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c1ed6402
Commit
c1ed6402
authored
Dec 01, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefix signal definitions with MSVCRT_ to avoid conflicts with system
headers.
parent
e21a97da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
25 deletions
+50
-25
except.c
dlls/msvcrt/except.c
+24
-25
msvcrt.h
dlls/msvcrt/msvcrt.h
+16
-0
headers.c
dlls/msvcrt/tests/headers.c
+10
-0
No files found.
dlls/msvcrt/except.c
View file @
c1ed6402
...
...
@@ -40,7 +40,6 @@
#include "excpt.h"
#include "wincon.h"
#include "msvcrt/float.h"
#include "msvcrt/signal.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msvcrt
);
...
...
@@ -380,7 +379,7 @@ void __stdcall _seh_longjmp_unwind(struct MSVCRT___JUMP_BUFFER *jmp)
}
#endif
/* i386 */
static
__sighandler_t
sighandlers
[
NSIG
]
=
{
SIG_DFL
};
static
MSVCRT___sighandler_t
sighandlers
[
MSVCRT_NSIG
]
=
{
MSVCRT_
SIG_DFL
};
static
BOOL
WINAPI
msvcrt_console_handler
(
DWORD
ctrlType
)
{
...
...
@@ -389,10 +388,10 @@ static BOOL WINAPI msvcrt_console_handler(DWORD ctrlType)
switch
(
ctrlType
)
{
case
CTRL_C_EVENT
:
if
(
sighandlers
[
SIGINT
])
if
(
sighandlers
[
MSVCRT_
SIGINT
])
{
if
(
sighandlers
[
SIGINT
]
!=
SIG_IGN
)
sighandlers
[
SIGINT
](
SIGINT
);
if
(
sighandlers
[
MSVCRT_SIGINT
]
!=
MSVCRT_
SIG_IGN
)
sighandlers
[
MSVCRT_SIGINT
](
MSVCRT_
SIGINT
);
ret
=
TRUE
;
}
break
;
...
...
@@ -427,10 +426,10 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
switch
(
except
->
ExceptionRecord
->
ExceptionCode
)
{
case
EXCEPTION_ACCESS_VIOLATION
:
if
(
sighandlers
[
SIGSEGV
])
if
(
sighandlers
[
MSVCRT_
SIGSEGV
])
{
if
(
sighandlers
[
SIGSEGV
]
!=
SIG_IGN
)
sighandlers
[
SIGSEGV
](
SIGSEGV
);
if
(
sighandlers
[
MSVCRT_SIGSEGV
]
!=
MSVCRT_
SIG_IGN
)
sighandlers
[
MSVCRT_SIGSEGV
](
MSVCRT_
SIGSEGV
);
ret
=
EXCEPTION_CONTINUE_EXECUTION
;
}
break
;
...
...
@@ -446,13 +445,13 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
case
EXCEPTION_FLT_OVERFLOW
:
case
EXCEPTION_FLT_STACK_CHECK
:
case
EXCEPTION_FLT_UNDERFLOW
:
if
(
sighandlers
[
SIGFPE
])
if
(
sighandlers
[
MSVCRT_
SIGFPE
])
{
if
(
sighandlers
[
SIGFPE
]
!=
SIG_IGN
)
if
(
sighandlers
[
MSVCRT_SIGFPE
]
!=
MSVCRT_
SIG_IGN
)
{
int
i
,
float_signal
=
_FPE_INVALID
;
float_handler
handler
=
(
float_handler
)
sighandlers
[
SIGFPE
];
float_handler
handler
=
(
float_handler
)
sighandlers
[
MSVCRT_
SIGFPE
];
for
(
i
=
0
;
i
<
sizeof
(
float_exception_map
)
/
sizeof
(
float_exception_map
[
0
]);
i
++
)
if
(
float_exception_map
[
i
].
status
==
...
...
@@ -461,16 +460,16 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except)
float_signal
=
float_exception_map
[
i
].
signal
;
break
;
}
handler
(
SIGFPE
,
float_signal
);
handler
(
MSVCRT_
SIGFPE
,
float_signal
);
}
ret
=
EXCEPTION_CONTINUE_EXECUTION
;
}
break
;
case
EXCEPTION_ILLEGAL_INSTRUCTION
:
if
(
sighandlers
[
SIGILL
])
if
(
sighandlers
[
MSVCRT_
SIGILL
])
{
if
(
sighandlers
[
SIGILL
]
!=
SIG_IGN
)
sighandlers
[
SIGILL
](
SIGILL
);
if
(
sighandlers
[
MSVCRT_SIGILL
]
!=
MSVCRT_
SIG_IGN
)
sighandlers
[
MSVCRT_SIGILL
](
MSVCRT_
SIGILL
);
ret
=
EXCEPTION_CONTINUE_EXECUTION
;
}
break
;
...
...
@@ -497,30 +496,30 @@ void msvcrt_free_signals(void)
* Some signals may never be generated except through an explicit call to
* raise.
*/
__sighandler_t
MSVCRT_signal
(
int
sig
,
__sighandler_t
func
)
MSVCRT___sighandler_t
MSVCRT_signal
(
int
sig
,
MSVCRT_
__sighandler_t
func
)
{
__sighandler_t
ret
=
SIG_ERR
;
MSVCRT___sighandler_t
ret
=
MSVCRT_
SIG_ERR
;
TRACE
(
"(%d, %p)
\n
"
,
sig
,
func
);
if
(
func
==
SIG_ERR
)
return
SIG_ERR
;
if
(
func
==
MSVCRT_SIG_ERR
)
return
MSVCRT_
SIG_ERR
;
switch
(
sig
)
{
/* Cases handled internally. Note SIGTERM is never generated by Windows,
* so we effectively mask it.
*/
case
SIGABRT
:
case
SIGFPE
:
case
SIGILL
:
case
SIGSEGV
:
case
SIGINT
:
case
SIGTERM
:
case
MSVCRT_
SIGABRT
:
case
MSVCRT_
SIGFPE
:
case
MSVCRT_
SIGILL
:
case
MSVCRT_
SIGSEGV
:
case
MSVCRT_
SIGINT
:
case
MSVCRT_
SIGTERM
:
ret
=
sighandlers
[
sig
];
sighandlers
[
sig
]
=
func
;
break
;
default:
ret
=
SIG_ERR
;
ret
=
MSVCRT_
SIG_ERR
;
}
return
ret
;
}
...
...
dlls/msvcrt/msvcrt.h
View file @
c1ed6402
...
...
@@ -555,6 +555,22 @@ struct MSVCRT__stati64 {
#define MSVCRT_CLOCKS_PER_SEC 1000
/* signals */
#define MSVCRT_SIGINT 2
#define MSVCRT_SIGILL 4
#define MSVCRT_SIGFPE 8
#define MSVCRT_SIGSEGV 11
#define MSVCRT_SIGTERM 15
#define MSVCRT_SIGBREAK 21
#define MSVCRT_SIGABRT 22
#define MSVCRT_NSIG (MSVCRT_SIGABRT + 1)
typedef
void
(
*
MSVCRT___sighandler_t
)(
int
);
#define MSVCRT_SIG_DFL ((MSVCRT___sighandler_t)0)
#define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
#define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
void
MSVCRT_free
(
void
*
);
void
*
MSVCRT_malloc
(
MSVCRT_size_t
);
void
*
MSVCRT_calloc
(
MSVCRT_size_t
,
MSVCRT_size_t
);
...
...
dlls/msvcrt/tests/headers.c
View file @
c1ed6402
...
...
@@ -48,6 +48,7 @@
#include "conio.h"
#include "process.h"
#include "string.h"
#include "signal.h"
#include "time.h"
#include "locale.h"
#include "setjmp.h"
...
...
@@ -96,6 +97,7 @@ static void test_types(void)
CHECK_TYPE
(
_se_translator_function
);
CHECK_TYPE
(
_beginthread_start_routine_t
);
CHECK_TYPE
(
_onexit_t
);
CHECK_TYPE
(
__sighandler_t
);
}
/************* Checking structs ***************/
...
...
@@ -437,6 +439,14 @@ static void test_defines(void)
CHECK_DEF
(
"_FPCLASS_PD"
,
_FPCLASS_PD
,
MSVCRT__FPCLASS_PD
);
CHECK_DEF
(
"_FPCLASS_PN"
,
_FPCLASS_PN
,
MSVCRT__FPCLASS_PN
);
CHECK_DEF
(
"_FPCLASS_PINF"
,
_FPCLASS_PINF
,
MSVCRT__FPCLASS_PINF
);
CHECK_DEF
(
"SIGINT"
,
SIGINT
,
MSVCRT_SIGINT
);
CHECK_DEF
(
"SIGILL"
,
SIGILL
,
MSVCRT_SIGILL
);
CHECK_DEF
(
"SIGFPE"
,
SIGFPE
,
MSVCRT_SIGFPE
);
CHECK_DEF
(
"SIGSEGV"
,
SIGSEGV
,
MSVCRT_SIGSEGV
);
CHECK_DEF
(
"SIGTERM"
,
SIGTERM
,
MSVCRT_SIGTERM
);
CHECK_DEF
(
"SIGBREAK"
,
SIGBREAK
,
MSVCRT_SIGBREAK
);
CHECK_DEF
(
"SIGABRT"
,
SIGABRT
,
MSVCRT_SIGABRT
);
CHECK_DEF
(
"NSIG"
,
NSIG
,
MSVCRT_NSIG
);
#ifdef __i386__
CHECK_DEF
(
"_EM_INVALID"
,
_EM_INVALID
,
MSVCRT__EM_INVALID
);
CHECK_DEF
(
"_EM_DENORMAL"
,
_EM_DENORMAL
,
MSVCRT__EM_DENORMAL
);
...
...
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