From 30aa58b84d3be926620d90e309bea0026e65751f Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Mon, 5 Aug 2019 17:36:09 +0300 Subject: [PATCH] Separating private from public headers. --- src/njs.h | 2 ++ src/njs_clang.h | 1 - src/njs_diyfp.h | 3 --- src/njs_main.h | 3 +++ src/njs_malloc.h | 10 ---------- src/njs_math.h | 3 --- src/njs_number.h | 4 ---- src/njs_pcre.c | 1 - src/njs_regexp_pattern.h | 3 --- src/njs_string.h | 1 - src/njs_types.h | 2 +- src/njs_unix.h | 13 ++++++++++--- src/njs_value.h | 10 ---------- src/test/njs_benchmark.c | 1 - src/test/njs_interactive_test.c | 1 - 15 files changed, 16 insertions(+), 42 deletions(-) diff --git a/src/njs.h b/src/njs.h index c72a9969..8fa3b33e 100644 --- a/src/njs.h +++ b/src/njs.h @@ -14,10 +14,12 @@ #define NJS_VERSION "0.3.4" +#include /* STDOUT_FILENO, STDERR_FILENO */ #include #include #include #include +#include typedef uintptr_t njs_index_t; diff --git a/src/njs_clang.h b/src/njs_clang.h index 04b07ff5..f3c306af 100644 --- a/src/njs_clang.h +++ b/src/njs_clang.h @@ -10,7 +10,6 @@ #include #include /* offsetof(). */ -#include /* NULL. */ #define njs_inline static inline __attribute__((always_inline)) diff --git a/src/njs_diyfp.h b/src/njs_diyfp.h index e7190a7c..bcfa6384 100644 --- a/src/njs_diyfp.h +++ b/src/njs_diyfp.h @@ -11,9 +11,6 @@ #ifndef _NJS_DIYFP_H_INCLUDED_ #define _NJS_DIYFP_H_INCLUDED_ -#include -#include - typedef struct { uint64_t significand; diff --git a/src/njs_main.h b/src/njs_main.h index b8041ce1..45efcb29 100644 --- a/src/njs_main.h +++ b/src/njs_main.h @@ -31,6 +31,9 @@ #include #include +#include +#include + #include #include #include diff --git a/src/njs_malloc.h b/src/njs_malloc.h index 6cd30680..a737f14e 100644 --- a/src/njs_malloc.h +++ b/src/njs_malloc.h @@ -7,16 +7,6 @@ #ifndef _NJS_MALLOC_H_INCLUDED_ #define _NJS_MALLOC_H_INCLUDED_ -#include - -/* - * alloca() is defined in stdlib.h in Linux, FreeBSD and MacOSX - * and in alloca.h in Linux, Solaris and MacOSX. - */ -#if (NJS_SOLARIS) -#include -#endif - #define njs_malloc(size) malloc(size) #define njs_free(p) free(p) diff --git a/src/njs_math.h b/src/njs_math.h index 11f8c169..af74ae26 100644 --- a/src/njs_math.h +++ b/src/njs_math.h @@ -8,9 +8,6 @@ #define _NJS_MATH_H_INCLUDED_ -#include - - extern const njs_object_init_t njs_math_object_init; diff --git a/src/njs_number.h b/src/njs_number.h index cc4a9997..16b75b2e 100644 --- a/src/njs_number.h +++ b/src/njs_number.h @@ -8,10 +8,6 @@ #define _NJS_NUMBER_H_INCLUDED_ -#include -#include - - uint32_t njs_value_to_index(const njs_value_t *value); double njs_number_dec_parse(const u_char **start, const u_char *end); uint64_t njs_number_oct_parse(const u_char **start, const u_char *end); diff --git a/src/njs_pcre.c b/src/njs_pcre.c index 92cc5e15..f3016f48 100644 --- a/src/njs_pcre.c +++ b/src/njs_pcre.c @@ -6,7 +6,6 @@ #include -#include static void *njs_pcre_malloc(size_t size); diff --git a/src/njs_regexp_pattern.h b/src/njs_regexp_pattern.h index 12228df1..95716555 100644 --- a/src/njs_regexp_pattern.h +++ b/src/njs_regexp_pattern.h @@ -7,9 +7,6 @@ #ifndef _NJS_REGEXP_PATTERN_H_INCLUDED_ #define _NJS_REGEXP_PATTERN_H_INCLUDED_ -#include -#include - typedef enum { NJS_REGEXP_BYTE = 0, diff --git a/src/njs_string.h b/src/njs_string.h index 01adf15a..e280e502 100644 --- a/src/njs_string.h +++ b/src/njs_string.h @@ -7,7 +7,6 @@ #ifndef _NJS_STRING_H_INCLUDED_ #define _NJS_STRING_H_INCLUDED_ -#include /* * nJSVM supports two string variants: diff --git a/src/njs_types.h b/src/njs_types.h index a47e2391..c38cb9dc 100644 --- a/src/njs_types.h +++ b/src/njs_types.h @@ -23,7 +23,7 @@ /* u_char, u_int, int8_t, int32_t, int64_t, size_t, off_t. */ #include -#include +#include #if (__LP64__) diff --git a/src/njs_unix.h b/src/njs_unix.h index 442cf8b6..89e8a6b7 100644 --- a/src/njs_unix.h +++ b/src/njs_unix.h @@ -22,17 +22,24 @@ #endif /* NJS_LINUX */ + #include -#include -#include /* offsetof() */ +#include #include -#include #include #include #include #include #include +/* + * alloca() is defined in stdlib.h in Linux, FreeBSD and MacOSX + * and in alloca.h in Linux, Solaris and MacOSX. + */ +#if (NJS_SOLARIS) +#include +#endif + #include #include #include diff --git a/src/njs_value.h b/src/njs_value.h index 20c99336..b59ef9e0 100644 --- a/src/njs_value.h +++ b/src/njs_value.h @@ -8,16 +8,6 @@ #define _NJS_VALUE_H_INCLUDED_ -#include -#include -#include -#include -#include -#include - -#include - - /* * The order of the enum is used in njs_vmcode_typeof() * and njs_object_prototype_to_string(). diff --git a/src/test/njs_benchmark.c b/src/test/njs_benchmark.c index 98fa9603..4692eb1d 100644 --- a/src/test/njs_benchmark.c +++ b/src/test/njs_benchmark.c @@ -5,7 +5,6 @@ */ #include -#include #include #include diff --git a/src/test/njs_interactive_test.c b/src/test/njs_interactive_test.c index a8b27384..391f0ec2 100644 --- a/src/test/njs_interactive_test.c +++ b/src/test/njs_interactive_test.c @@ -5,7 +5,6 @@ */ #include -#include #include #include -- 2.47.3