diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/Makefile.am | 2 | ||||
-rw-r--r-- | src/include/platform_interface.h | 55 | ||||
-rw-r--r-- | src/include/w32functions.h | 55 |
3 files changed, 1 insertions, 111 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 42425ad8..24102d94 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am | |||
@@ -3,4 +3,4 @@ SUBDIRS = . | |||
3 | 3 | ||
4 | include_HEADERS = microhttpd.h | 4 | include_HEADERS = microhttpd.h |
5 | 5 | ||
6 | EXTRA_DIST = platform.h platform_interface.h w32functions.h autoinit_funcs.h | 6 | EXTRA_DIST = platform.h autoinit_funcs.h |
diff --git a/src/include/platform_interface.h b/src/include/platform_interface.h deleted file mode 100644 index b641a002..00000000 --- a/src/include/platform_interface.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of libmicrohttpd | ||
3 | Copyright (C) 2014 Karlson2k (Evgeny Grin) | ||
4 | |||
5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Lesser General Public | ||
7 | License as published by the Free Software Foundation; either | ||
8 | version 2.1 of the License, or (at your option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Lesser General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Lesser General Public | ||
16 | License along with this library. | ||
17 | If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | /** | ||
21 | * @file include/platform_interface.h | ||
22 | * @brief internal platform abstraction functions | ||
23 | * @author Karlson2k (Evgeny Grin) | ||
24 | */ | ||
25 | |||
26 | #ifndef MHD_PLATFORM_INTERFACE_H | ||
27 | #define MHD_PLATFORM_INTERFACE_H | ||
28 | |||
29 | #include "platform.h" | ||
30 | #if defined(_WIN32) && !defined(__CYGWIN__) | ||
31 | #include "w32functions.h" | ||
32 | #endif | ||
33 | |||
34 | /* ***************************** | ||
35 | General function mapping | ||
36 | *****************************/ | ||
37 | |||
38 | /* Platform-independent snprintf name */ | ||
39 | #if defined(HAVE_SNPRINTF) | ||
40 | #define MHD_snprintf_ snprintf | ||
41 | #else /* ! HAVE_SNPRINTF */ | ||
42 | #if defined(_WIN32) | ||
43 | #define MHD_snprintf_ W32_snprintf | ||
44 | #else /* ! _WIN32*/ | ||
45 | #error Your platform does not support snprintf() and MHD does not know how to emulate it on your platform. | ||
46 | #endif /* ! _WIN32*/ | ||
47 | #endif /* ! HAVE_SNPRINTF */ | ||
48 | |||
49 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
50 | #define MHD_random_() random() | ||
51 | #else | ||
52 | #define MHD_random_() MHD_W32_random_() | ||
53 | #endif | ||
54 | |||
55 | #endif /* MHD_PLATFORM_INTERFACE_H */ | ||
diff --git a/src/include/w32functions.h b/src/include/w32functions.h deleted file mode 100644 index 0694a381..00000000 --- a/src/include/w32functions.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of libmicrohttpd | ||
3 | Copyright (C) 2014 Karlson2k (Evgeny Grin) | ||
4 | |||
5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Lesser General Public | ||
7 | License as published by the Free Software Foundation; either | ||
8 | version 2.1 of the License, or (at your option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Lesser General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Lesser General Public | ||
16 | License along with this library. | ||
17 | If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | /** | ||
21 | * @file include/w32functions.h | ||
22 | * @brief internal functions for W32 systems | ||
23 | * @author Karlson2k (Evgeny Grin) | ||
24 | */ | ||
25 | |||
26 | #ifndef MHD_W32FUNCTIONS_H | ||
27 | #define MHD_W32FUNCTIONS_H | ||
28 | #ifndef _WIN32 | ||
29 | #error w32functions.h is designed only for W32 systems | ||
30 | #endif | ||
31 | |||
32 | #include "platform.h" | ||
33 | #include <errno.h> | ||
34 | #include <winsock2.h> | ||
35 | #include "platform_interface.h" | ||
36 | |||
37 | #ifdef __cplusplus | ||
38 | extern "C" | ||
39 | { | ||
40 | #endif | ||
41 | |||
42 | /** | ||
43 | * Generate 31-bit pseudo random number. | ||
44 | * Function initialize itself at first call to current time. | ||
45 | * @return 31-bit pseudo random number. | ||
46 | */ | ||
47 | int MHD_W32_random_(void); | ||
48 | |||
49 | /* Emulate snprintf function on W32 */ | ||
50 | int W32_snprintf(char *__restrict s, size_t n, const char *__restrict format, ...); | ||
51 | |||
52 | #ifdef __cplusplus | ||
53 | } | ||
54 | #endif | ||
55 | #endif /* MHD_W32FUNCTIONS_H */ | ||