diff options
Diffstat (limited to 'src/microhttpd/mhd_compat.h')
-rw-r--r-- | src/microhttpd/mhd_compat.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/microhttpd/mhd_compat.h b/src/microhttpd/mhd_compat.h index b4e2c66c..6b38a03e 100644 --- a/src/microhttpd/mhd_compat.h +++ b/src/microhttpd/mhd_compat.h | |||
@@ -40,8 +40,8 @@ | |||
40 | #include <string.h> | 40 | #include <string.h> |
41 | #endif /* HAVE_STRING_H */ | 41 | #endif /* HAVE_STRING_H */ |
42 | 42 | ||
43 | /* MHD_strerror_ is strerror */ | 43 | /* MHD_strerror_ is strerror */ |
44 | #define MHD_strerror_(errnum) strerror((errnum)) | 44 | #define MHD_strerror_(errnum) strerror ((errnum)) |
45 | 45 | ||
46 | /* Platform-independent snprintf name */ | 46 | /* Platform-independent snprintf name */ |
47 | #if defined(HAVE_SNPRINTF) | 47 | #if defined(HAVE_SNPRINTF) |
@@ -49,10 +49,12 @@ | |||
49 | #else /* ! HAVE_SNPRINTF */ | 49 | #else /* ! HAVE_SNPRINTF */ |
50 | #if defined(_WIN32) && ! defined(__CYGWIN__) | 50 | #if defined(_WIN32) && ! defined(__CYGWIN__) |
51 | /* Emulate snprintf function on W32 */ | 51 | /* Emulate snprintf function on W32 */ |
52 | int W32_snprintf(char *__restrict s, size_t n, const char *__restrict format, ...); | 52 | int W32_snprintf (char *__restrict s, size_t n, const char *__restrict format, |
53 | ...); | ||
53 | #define MHD_snprintf_ W32_snprintf | 54 | #define MHD_snprintf_ W32_snprintf |
54 | #else /* ! _WIN32 || __CYGWIN__ */ | 55 | #else /* ! _WIN32 || __CYGWIN__ */ |
55 | #error Your platform does not support snprintf() and MHD does not know how to emulate it on your platform. | 56 | #error \ |
57 | Your platform does not support snprintf() and MHD does not know how to emulate it on your platform. | ||
56 | #endif /* ! _WIN32 || __CYGWIN__ */ | 58 | #endif /* ! _WIN32 || __CYGWIN__ */ |
57 | #endif /* ! HAVE_SNPRINTF */ | 59 | #endif /* ! HAVE_SNPRINTF */ |
58 | 60 | ||
@@ -61,14 +63,14 @@ int W32_snprintf(char *__restrict s, size_t n, const char *__restrict format, .. | |||
61 | * Generate pseudo random number at least 30-bit wide. | 63 | * Generate pseudo random number at least 30-bit wide. |
62 | * @return pseudo random number at least 30-bit wide. | 64 | * @return pseudo random number at least 30-bit wide. |
63 | */ | 65 | */ |
64 | #define MHD_random_() random() | 66 | #define MHD_random_() random () |
65 | #else /* HAVE_RANDOM */ | 67 | #else /* HAVE_RANDOM */ |
66 | #ifdef HAVE_RAND | 68 | #ifdef HAVE_RAND |
67 | /** | 69 | /** |
68 | * Generate pseudo random number at least 30-bit wide. | 70 | * Generate pseudo random number at least 30-bit wide. |
69 | * @return pseudo random number at least 30-bit wide. | 71 | * @return pseudo random number at least 30-bit wide. |
70 | */ | 72 | */ |
71 | #define MHD_random_() ( (((long)rand()) << 15) + (long)rand() ) | 73 | #define MHD_random_() ( (((long) rand ()) << 15) + (long) rand () ) |
72 | #endif /* HAVE_RAND */ | 74 | #endif /* HAVE_RAND */ |
73 | #endif /* HAVE_RANDOM */ | 75 | #endif /* HAVE_RANDOM */ |
74 | 76 | ||
@@ -76,12 +78,12 @@ int W32_snprintf(char *__restrict s, size_t n, const char *__restrict format, .. | |||
76 | /** | 78 | /** |
77 | * MHD_calloc_ is platform-independent calloc() | 79 | * MHD_calloc_ is platform-independent calloc() |
78 | */ | 80 | */ |
79 | #define MHD_calloc_(n,s) calloc((n),(s)) | 81 | #define MHD_calloc_(n,s) calloc ((n),(s)) |
80 | #else /* ! HAVE_CALLOC */ | 82 | #else /* ! HAVE_CALLOC */ |
81 | /** | 83 | /** |
82 | * MHD_calloc_ is platform-independent calloc() | 84 | * MHD_calloc_ is platform-independent calloc() |
83 | */ | 85 | */ |
84 | void *MHD_calloc_(size_t nelem, size_t elsize); | 86 | void *MHD_calloc_ (size_t nelem, size_t elsize); |
85 | #endif /* ! HAVE_CALLOC */ | 87 | #endif /* ! HAVE_CALLOC */ |
86 | 88 | ||
87 | #endif /* MHD_COMPAT_H */ | 89 | #endif /* MHD_COMPAT_H */ |