You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/10/23 06:29:02 UTC
[incubator-nuttx-apps] 07/07: Revert "netutils/thttpd: remove MIN and MAX definitions from libhttpd.h"
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch revert-1377-minor_fixes
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit 3841fb5c85f8f2e8999ef6c14341b3d99d1eda45
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Sun Oct 23 09:28:49 2022 +0300
Revert "netutils/thttpd: remove MIN and MAX definitions from libhttpd.h"
This reverts commit c52f40770e5368980e334048423f5a46fe1f4fef.
---
examples/ajoystick/ajoy_main.c | 1 -
examples/djoystick/djoy_main.c | 1 -
examples/nunchuck/nunchuck_main.c | 1 -
examples/zerocross/zerocross_main.c | 1 -
netutils/thttpd/libhttpd.c | 1 +
netutils/thttpd/libhttpd.h | 10 +++++++++-
6 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/examples/ajoystick/ajoy_main.c b/examples/ajoystick/ajoy_main.c
index c421328a4..398a787a9 100644
--- a/examples/ajoystick/ajoy_main.c
+++ b/examples/ajoystick/ajoy_main.c
@@ -59,7 +59,6 @@
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
-
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
diff --git a/examples/djoystick/djoy_main.c b/examples/djoystick/djoy_main.c
index 54d72d9e1..39f809782 100644
--- a/examples/djoystick/djoy_main.c
+++ b/examples/djoystick/djoy_main.c
@@ -56,7 +56,6 @@
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
-
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
diff --git a/examples/nunchuck/nunchuck_main.c b/examples/nunchuck/nunchuck_main.c
index c0e1a2059..2e28ebbc7 100644
--- a/examples/nunchuck/nunchuck_main.c
+++ b/examples/nunchuck/nunchuck_main.c
@@ -55,7 +55,6 @@
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
-
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
diff --git a/examples/zerocross/zerocross_main.c b/examples/zerocross/zerocross_main.c
index c96f8b24b..a7dc72b56 100644
--- a/examples/zerocross/zerocross_main.c
+++ b/examples/zerocross/zerocross_main.c
@@ -56,7 +56,6 @@
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
-
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
diff --git a/netutils/thttpd/libhttpd.c b/netutils/thttpd/libhttpd.c
index b4009d28a..30ea11411 100644
--- a/netutils/thttpd/libhttpd.c
+++ b/netutils/thttpd/libhttpd.c
@@ -95,6 +95,7 @@ extern CODE char *crypt(const char *key, const char *setting);
#ifndef MAX
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
+
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
diff --git a/netutils/thttpd/libhttpd.h b/netutils/thttpd/libhttpd.h
index 4422fcf07..fd0e657e8 100644
--- a/netutils/thttpd/libhttpd.h
+++ b/netutils/thttpd/libhttpd.h
@@ -55,13 +55,21 @@
#include <time.h>
#include "config.h"
-
#ifdef CONFIG_THTTPD
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+/* A few convenient defines. */
+
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
+#endif
+
/* Enable special instrumentation to track down "400 Bad Request" problems */
#undef CONFIG_THTTPD_BADREQUEST /* Define to enable "Bad Request" instrumentation */