[njs] Removing njs_stub.h.

Dmitry Volyntsev xeioex at nginx.com
Fri Aug 2 09:32:09 UTC 2019


details:   https://hg.nginx.org/njs/rev/81b272f75471
branches:  
changeset: 1094:81b272f75471
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Aug 02 12:12:35 2019 +0300
description:
Removing njs_stub.h.

diffstat:

 src/njs.h                   |   1 -
 src/njs_clang.h             |   6 ++++++
 src/njs_djb_hash.c          |   1 -
 src/njs_lvlhsh.c            |   1 -
 src/njs_main.h              |   1 -
 src/njs_mp.c                |   1 -
 src/njs_pcre.c              |   1 -
 src/njs_sprintf.c           |   1 -
 src/njs_stub.h              |  34 ----------------------------------
 src/njs_trace.h             |   6 ++++++
 src/njs_types.h             |   7 +++++++
 src/njs_unix.h              |   3 +++
 src/test/lvlhsh_unit_test.c |   1 -
 src/test/random_unit_test.c |   1 -
 src/test/rbtree_unit_test.c |   1 -
 src/test/utf8_unit_test.c   |   1 -
 16 files changed, 22 insertions(+), 45 deletions(-)

diffs (221 lines):

diff -r aaec532e9d08 -r 81b272f75471 src/njs.h
--- a/src/njs.h	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs.h	Fri Aug 02 12:12:35 2019 +0300
@@ -17,7 +17,6 @@
 #include <njs_types.h>
 #include <njs_clang.h>
 #include <njs_str.h>
-#include <njs_stub.h>
 #include <njs_lvlhsh.h>
 
 
diff -r aaec532e9d08 -r 81b272f75471 src/njs_clang.h
--- a/src/njs_clang.h	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_clang.h	Fri Aug 02 12:12:35 2019 +0300
@@ -24,6 +24,12 @@
 #define njs_nitems(x)                                                         \
     (sizeof(x) / sizeof((x)[0]))
 
+#define njs_max(val1, val2)                                                   \
+    ((val1 < val2) ? (val2) : (val1))
+
+#define njs_min(val1, val2)                                                   \
+    ((val1 < val2) ? (val1) : (val2))
+
 
 #if (NJS_HAVE_BUILTIN_EXPECT)
 #define njs_expect(c, x)   __builtin_expect((long) (x), (c))
diff -r aaec532e9d08 -r 81b272f75471 src/njs_djb_hash.c
--- a/src/njs_djb_hash.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_djb_hash.c	Fri Aug 02 12:12:35 2019 +0300
@@ -8,7 +8,6 @@
 #include <njs_types.h>
 #include <njs_clang.h>
 #include <njs_str.h>
-#include <njs_stub.h>
 #include <njs_djb_hash.h>
 
 
diff -r aaec532e9d08 -r 81b272f75471 src/njs_lvlhsh.c
--- a/src/njs_lvlhsh.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_lvlhsh.c	Fri Aug 02 12:12:35 2019 +0300
@@ -8,7 +8,6 @@
 #include <njs_types.h>
 #include <njs_clang.h>
 #include <njs_str.h>
-#include <njs_stub.h>
 #include <njs_lvlhsh.h>
 #include <string.h>
 
diff -r aaec532e9d08 -r 81b272f75471 src/njs_main.h
--- a/src/njs_main.h	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_main.h	Fri Aug 02 12:12:35 2019 +0300
@@ -14,7 +14,6 @@
 #include <njs_types.h>
 #include <njs_clang.h>
 #include <njs_str.h>
-#include <njs_stub.h>
 #include <njs_utf8.h>
 #include <njs_dtoa.h>
 #include <njs_strtod.h>
diff -r aaec532e9d08 -r 81b272f75471 src/njs_mp.c
--- a/src/njs_mp.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_mp.c	Fri Aug 02 12:12:35 2019 +0300
@@ -7,7 +7,6 @@
 #include <njs_auto_config.h>
 #include <njs_types.h>
 #include <njs_clang.h>
-#include <njs_stub.h>
 #include <njs_str.h>
 #include <njs_sprintf.h>
 #include <njs_malloc.h>
diff -r aaec532e9d08 -r 81b272f75471 src/njs_pcre.c
--- a/src/njs_pcre.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_pcre.c	Fri Aug 02 12:12:35 2019 +0300
@@ -7,7 +7,6 @@
 #include <njs_auto_config.h>
 #include <njs_types.h>
 #include <njs_clang.h>
-#include <njs_stub.h>
 #include <njs_trace.h>
 #include <njs_str.h>
 #include <njs_regex.h>
diff -r aaec532e9d08 -r 81b272f75471 src/njs_sprintf.c
--- a/src/njs_sprintf.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_sprintf.c	Fri Aug 02 12:12:35 2019 +0300
@@ -7,7 +7,6 @@
 #include <njs_auto_config.h>
 #include <njs_types.h>
 #include <njs_clang.h>
-#include <njs_stub.h>
 #include <njs_str.h>
 #include <njs_sprintf.h>
 
diff -r aaec532e9d08 -r 81b272f75471 src/njs_stub.h
--- a/src/njs_stub.h	Fri Aug 02 12:12:30 2019 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) NGINX, Inc.
- */
-
-#ifndef _NJS_STUB_H_INCLUDED_
-#define _NJS_STUB_H_INCLUDED_
-
-
-#define njs_max(val1, val2)                                                   \
-    ((val1 < val2) ? (val2) : (val1))
-
-#define njs_min(val1, val2)                                                   \
-    ((val1 < val2) ? (val1) : (val2))
-
-
-#define NJS_OK             0
-#define NJS_ERROR          (-1)
-#define NJS_AGAIN          (-2)
-#define NJS_DECLINED       (-3)
-#define NJS_DONE           (-4)
-
-
-#define njs_thread_log_alert(...)
-#define njs_thread_log_error(...)
-#define njs_log_error(...)
-#define njs_thread_log_debug(...)
-
-#include <unistd.h>
-#define njs_pagesize()      getpagesize()
-
-
-#endif /* _NJS_STUB_H_INCLUDED_ */
diff -r aaec532e9d08 -r 81b272f75471 src/njs_trace.h
--- a/src/njs_trace.h	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_trace.h	Fri Aug 02 12:12:35 2019 +0300
@@ -61,6 +61,12 @@ struct njs_trace_s {
     } while (0)
 
 
+#define njs_thread_log_alert(...)
+#define njs_thread_log_error(...)
+#define njs_log_error(...)
+#define njs_thread_log_debug(...)
+
+
 NJS_EXPORT void njs_trace_handler(njs_trace_t *trace, uint32_t level,
     const char *fmt, ...);
 
diff -r aaec532e9d08 -r 81b272f75471 src/njs_types.h
--- a/src/njs_types.h	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_types.h	Fri Aug 02 12:12:35 2019 +0300
@@ -8,6 +8,13 @@
 #define _NJS_TYPES_H_INCLUDED_
 
 
+#define NJS_OK             0
+#define NJS_ERROR          (-1)
+#define NJS_AGAIN          (-2)
+#define NJS_DECLINED       (-3)
+#define NJS_DONE           (-4)
+
+
 /*
  * off_t is 32 bit on Linux, Solaris and HP-UX by default.
  * Must be before <sys/types.h>.
diff -r aaec532e9d08 -r 81b272f75471 src/njs_unix.h
--- a/src/njs_unix.h	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/njs_unix.h	Fri Aug 02 12:12:35 2019 +0300
@@ -8,6 +8,9 @@
 #ifndef _NJS_UNIX_H_INCLUDED_
 #define _NJS_UNIX_H_INCLUDED_
 
+#include <unistd.h>
+#define njs_pagesize()      getpagesize()
+
 #if (NJS_LINUX)
 
 #ifdef _FORTIFY_SOURCE
diff -r aaec532e9d08 -r 81b272f75471 src/test/lvlhsh_unit_test.c
--- a/src/test/lvlhsh_unit_test.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/test/lvlhsh_unit_test.c	Fri Aug 02 12:12:35 2019 +0300
@@ -9,7 +9,6 @@
 #include <njs_clang.h>
 #include <njs_sprintf.h>
 #include <njs_str.h>
-#include <njs_stub.h>
 #include <njs_malloc.h>
 #include <njs_lvlhsh.h>
 #include <njs_murmur_hash.h>
diff -r aaec532e9d08 -r 81b272f75471 src/test/random_unit_test.c
--- a/src/test/random_unit_test.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/test/random_unit_test.c	Fri Aug 02 12:12:35 2019 +0300
@@ -9,7 +9,6 @@
 #include <njs_clang.h>
 #include <njs_sprintf.h>
 #include <njs_str.h>
-#include <njs_stub.h>
 #include <njs_random.h>
 #include <stdlib.h>
 #include <string.h>
diff -r aaec532e9d08 -r 81b272f75471 src/test/rbtree_unit_test.c
--- a/src/test/rbtree_unit_test.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/test/rbtree_unit_test.c	Fri Aug 02 12:12:35 2019 +0300
@@ -7,7 +7,6 @@
 #include <njs_auto_config.h>
 #include <njs_types.h>
 #include <njs_clang.h>
-#include <njs_stub.h>
 #include <njs_sprintf.h>
 #include <njs_str.h>
 #include <njs_rbtree.h>
diff -r aaec532e9d08 -r 81b272f75471 src/test/utf8_unit_test.c
--- a/src/test/utf8_unit_test.c	Fri Aug 02 12:12:30 2019 +0300
+++ b/src/test/utf8_unit_test.c	Fri Aug 02 12:12:35 2019 +0300
@@ -9,7 +9,6 @@
 #include <njs_clang.h>
 #include <njs_sprintf.h>
 #include <njs_str.h>
-#include <njs_stub.h>
 #include <njs_utf8.h>
 #include <string.h>
 


More information about the nginx-devel mailing list