-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade MHD version and CMake files for macOS support
- Loading branch information
1 parent
bdd812c
commit 355103e
Showing
5 changed files
with
25 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
# | ||
# Cross-platform library which helps to develop web servers or frameworks. | ||
# | ||
# Copyright (C) 2016-2020 Silvio Clecio <[email protected]> | ||
# Copyright (C) 2016-2024 Silvio Clecio <[email protected]> | ||
# | ||
# Sagui library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
|
@@ -71,8 +71,9 @@ else() | |
set(CC "CC=${CMAKE_C_COMPILER}") | ||
endif() | ||
|
||
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") | ||
set(CMAKE_COMPILER_IS_CLANG ON) | ||
if(CMAKE_C_COMPILER_LOADED AND CMAKE_C_COMPILER_ID MATCHES ".*[Cc][Ll][Aa][Nn][Gg].*") | ||
set(CMAKE_COMPILER_IS_CLANG ON) | ||
set(CMAKE_COMPILER_IS_GNUCC OFF) | ||
endif() | ||
|
||
if(NOT CMAKE_C_MACHINE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
# | ||
# Cross-platform library which helps to develop web servers or frameworks. | ||
# | ||
# Copyright (C) 2016-2023 Silvio Clecio <[email protected]> | ||
# Copyright (C) 2016-2024 Silvio Clecio <[email protected]> | ||
# | ||
# Sagui library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
|
@@ -43,11 +43,11 @@ endif() | |
set(__SG_MHD_INCLUDED ON) | ||
|
||
set(MHD_NAME "libmicrohttpd") | ||
set(MHD_VER "0.9.76") | ||
set(MHD_VER "0.9.77") | ||
set(MHD_FULL_NAME "${MHD_NAME}-${MHD_VER}") | ||
set(MHD_URL "https://ftp.gnu.org/gnu/libmicrohttpd/${MHD_FULL_NAME}.tar.gz") | ||
set(MHD_URL_MIRROR "https://ftp.gnu.org/gnu/libmicrohttpd/${MHD_FULL_NAME}.tar.gz") | ||
set(MHD_SHA256 "f0b1547b5a42a6c0f724e8e1c1cb5ce9c4c35fb495e7d780b9930d35011ceb4c") | ||
set(MHD_SHA256 "9e7023a151120060d2806a6ea4c13ca9933ece4eacfc5c9464d20edddb76b0a0") | ||
set(_libdir ${CMAKE_BINARY_DIR}/${MHD_FULL_NAME}/lib) | ||
if(${CMAKE_VERSION} VERSION_LESS "3.7") | ||
unset(MHD_URL_MIRROR) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* | ||
* Cross-platform library which helps to develop web servers or frameworks. | ||
* | ||
* Copyright (C) 2016-2023 Silvio Clecio <[email protected]> | ||
* Copyright (C) 2016-2024 Silvio Clecio <[email protected]> | ||
* | ||
* Sagui library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
|
@@ -74,7 +74,7 @@ extern "C" { | |
|
||
#define SG_VERSION_MAJOR 3 | ||
#define SG_VERSION_MINOR 4 | ||
#define SG_VERSION_PATCH 1 | ||
#define SG_VERSION_PATCH 2 | ||
#define SG_VERSION_HEX \ | ||
((SG_VERSION_MAJOR << 16) | (SG_VERSION_MINOR << 8) | (SG_VERSION_PATCH)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* | ||
* Cross-platform library which helps to develop web servers or frameworks. | ||
* | ||
* Copyright (C) 2016-2023 Silvio Clecio <[email protected]> | ||
* Copyright (C) 2016-2024 Silvio Clecio <[email protected]> | ||
* | ||
* Sagui library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
|
@@ -135,7 +135,7 @@ int sg__rename(const char *old, const char *new) { | |
#endif /* _WIN32 */ | ||
|
||
#if defined(_WIN32) || defined(__ANDROID__) || \ | ||
(defined(__linux__) && !defined(__gnu_linux__)) | ||
(defined(__linux__) && !defined(__gnu_linux__)) || defined(__APPLE__) | ||
|
||
char *sg__basename(const char *path) { | ||
char *s1 = strrchr(path, '/'); | ||
|
@@ -149,7 +149,7 @@ char *sg__basename(const char *path) { | |
return (char *) path; | ||
} | ||
|
||
#endif /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) */ | ||
#endif /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) || __APPLE__ */ | ||
|
||
char *sg__strdup(const char *str) { | ||
return str ? strdup(str) : NULL; | ||
|
@@ -295,36 +295,37 @@ double sg__fmod(double x, double y) { | |
|
||
char *sg_strerror(int errnum, char *errmsg, size_t errlen) { | ||
#if defined(_WIN32) || defined(__ANDROID__) || \ | ||
(defined(__linux__) && !defined(__gnu_linux__)) | ||
(defined(__linux__) && !defined(__gnu_linux__)) || defined(__APPLE__) | ||
int saved_errno; | ||
#else /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) */ | ||
#else /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) || __APPLE__ */ | ||
char *res; | ||
#endif /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) */ | ||
#endif /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) || __APPLE__ */ | ||
if (!errmsg || errlen < 1) | ||
return NULL; | ||
#if defined(_WIN32) || defined(__ANDROID__) || \ | ||
(defined(__linux__) && !defined(__gnu_linux__)) | ||
(defined(__linux__) && !defined(__gnu_linux__)) || defined(__APPLE__) | ||
saved_errno = errno; | ||
#else /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) */ | ||
#else /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) || __APPLE__ */ | ||
res = strerror_r(errnum, errmsg, errlen - 1); | ||
memcpy(errmsg, res, errlen - 1); | ||
errmsg[errlen - 1] = '\0'; | ||
return errmsg; | ||
#endif /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) */ | ||
#endif /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) || __APPLE__ */ | ||
#ifdef _WIN32 | ||
errnum = strerror_s(errmsg, errlen, errnum); | ||
errno = saved_errno; | ||
if ((errnum != 0) && (errnum != EINVAL)) | ||
return "?"; | ||
return errmsg; | ||
#endif /* _WIN32 */ | ||
#if defined(__ANDROID__) || (defined(__linux__) && !defined(__gnu_linux__)) | ||
#if defined(__ANDROID__) || (defined(__linux__) && !defined(__gnu_linux__)) || \ | ||
defined(__APPLE__) | ||
errnum = strerror_r(errnum, errmsg, errlen); | ||
errno = saved_errno; | ||
if ((errnum != 0) && (errnum != EINVAL) && (errnum != ERANGE)) | ||
return "?"; | ||
return errmsg; | ||
#endif /* __ANDROID__ || (__linux__ && !__gnu_linux__) */ | ||
#endif /* __ANDROID__ || (__linux__ && !__gnu_linux__) || __APPLE__ */ | ||
} | ||
|
||
bool sg_is_post(const char *method) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* | ||
* Cross-platform library which helps to develop web servers or frameworks. | ||
* | ||
* Copyright (C) 2016-2021 Silvio Clecio <[email protected]> | ||
* Copyright (C) 2016-2024 Silvio Clecio <[email protected]> | ||
* | ||
* Sagui library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
|
@@ -66,15 +66,15 @@ SG__EXTERN int sg__rename(const char *old, const char *new); | |
#endif /* _WIN32 */ | ||
|
||
#if defined(_WIN32) || defined(__ANDROID__) || \ | ||
(defined(__linux__) && !defined(__gnu_linux__)) | ||
(defined(__linux__) && !defined(__gnu_linux__)) || defined(__APPLE__) | ||
|
||
SG__EXTERN char *sg__basename(const char *path); | ||
|
||
#else /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) */ | ||
#else /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) || __APPLE__ */ | ||
|
||
#define sg__basename basename | ||
|
||
#endif /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) */ | ||
#endif /* _WIN32 || __ANDROID__ || (__linux__ && !__gnu_linux__) || __APPLE__ */ | ||
|
||
SG__EXTERN char *sg__strdup(const char *str); | ||
|
||
|