]>
Commit | Line | Data |
---|---|---|
1c001dd2 CS |
1 | /* woutsup.h: for Cygwin code compiled outside the DLL (i.e. cygserver). |
2 | ||
1c001dd2 CS |
3 | This file is part of Cygwin. |
4 | ||
5 | This software is a copyrighted work licensed under the terms of the | |
6 | Cygwin license. Please consult the file "CYGWIN_LICENSE" for | |
7 | details. */ | |
8 | ||
4d8d80b8 | 9 | #define _MT_SAFE 1 |
1c001dd2 CS |
10 | |
11 | #ifdef __INSIDE_CYGWIN__ | |
12 | #error "woutsup.h is not for code being compiled inside the dll" | |
13 | #endif | |
14 | ||
225d376b KB |
15 | #define fallthrough __attribute__((__fallthrough__)) |
16 | ||
1c001dd2 CS |
17 | #ifndef _WIN32_WINNT |
18 | #define _WIN32_WINNT 0x0500 | |
19 | #endif | |
20 | ||
21 | #if _WIN32_WINNT < 0x0500 | |
22 | #undef _WIN32_WINNT | |
23 | #define _WIN32_WINNT 0x0500 | |
24 | #endif | |
25 | ||
847a5f89 | 26 | #include "winlean.h" |
1c001dd2 | 27 | |
282113ba CV |
28 | #include "bsd_helper.h" |
29 | #include "bsd_log.h" | |
30 | #include "bsd_mutex.h" | |
31 | ||
1c001dd2 CS |
32 | /* The one function we use from winuser.h most of the time */ |
33 | extern "C" DWORD WINAPI GetLastError (void); | |
34 | ||
35 | extern int cygserver_running; | |
36 | ||
282113ba CV |
37 | #define SIGHANDLE(SIG) \ |
38 | do \ | |
39 | { \ | |
40 | struct sigaction act; \ | |
41 | \ | |
42 | act.sa_handler = &handle_signal; \ | |
43 | act.sa_mask = 0; \ | |
44 | act.sa_flags = 0; \ | |
45 | \ | |
46 | if (sigaction (SIG, &act, NULL) == -1) \ | |
47 | { \ | |
48 | panic ("failed to install handler for " #SIG ": %s", \ | |
49 | strerror (errno)); \ | |
50 | exit (1); \ | |
51 | } \ | |
1c001dd2 CS |
52 | } while (false) |
53 | ||
282113ba | 54 | #define debug_printf(f,...) debug((f),##__VA_ARGS__) |
663b4ab8 | 55 | #define syscall_printf(f,...) log(LOG_INFO,(f),##__VA_ARGS__) |
282113ba | 56 | #define system_printf(f,...) log(LOG_ERR,(f),##__VA_ARGS__) |