[PATCH] Style: add missing includes and include guards

Piotr Sikora piotrsikora at google.com
Mon Feb 22 06:26:28 UTC 2016


# HG changeset patch
# User Piotr Sikora <piotrsikora at google.com>
# Date 1456122112 28800
#      Sun Feb 21 22:21:52 2016 -0800
# Node ID 863f4a52ae07be12dfb9f57ba4280d490554e59d
# Parent  cfc3cfa434ec1e53989f8499e42bf448b9747ec9
Style: add missing includes and include guards.

Signed-off-by: Piotr Sikora <piotrsikora at google.com>

diff -r cfc3cfa434ec -r 863f4a52ae07 src/core/nginx.h
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -9,6 +9,10 @@
 #define _NGINX_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 #define nginx_version      1009012
 #define NGINX_VERSION      "1.9.12"
 #define NGINX_VER          "nginx/" NGINX_VERSION
diff -r cfc3cfa434ec -r 863f4a52ae07 src/core/ngx_syslog.h
--- a/src/core/ngx_syslog.h
+++ b/src/core/ngx_syslog.h
@@ -8,6 +8,10 @@
 #define _NGX_SYSLOG_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 typedef struct {
     ngx_pool_t       *pool;
     ngx_uint_t        facility;
diff -r cfc3cfa434ec -r 863f4a52ae07 src/event/modules/ngx_iocp_module.h
--- a/src/event/modules/ngx_iocp_module.h
+++ b/src/event/modules/ngx_iocp_module.h
@@ -9,6 +9,10 @@
 #define _NGX_IOCP_MODULE_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 typedef struct {
     int  threads;
     int  post_acceptex;
diff -r cfc3cfa434ec -r 863f4a52ae07 src/http/ngx_http_request.h
--- a/src/http/ngx_http_request.h
+++ b/src/http/ngx_http_request.h
@@ -9,6 +9,11 @@
 #define _NGX_HTTP_REQUEST_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_http.h>
+
+
 #define NGX_HTTP_MAX_URI_CHANGES           10
 #define NGX_HTTP_MAX_SUBREQUESTS           50
 
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_darwin.h
--- a/src/os/unix/ngx_darwin.h
+++ b/src/os/unix/ngx_darwin.h
@@ -9,6 +9,10 @@
 #define _NGX_DARWIN_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 void ngx_debug_init(void);
 ngx_chain_t *ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in,
     off_t limit);
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_freebsd.h
--- a/src/os/unix/ngx_freebsd.h
+++ b/src/os/unix/ngx_freebsd.h
@@ -9,6 +9,10 @@
 #define _NGX_FREEBSD_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 void ngx_debug_init(void);
 ngx_chain_t *ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in,
     off_t limit);
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_gcc_atomic_amd64.h
--- a/src/os/unix/ngx_gcc_atomic_amd64.h
+++ b/src/os/unix/ngx_gcc_atomic_amd64.h
@@ -5,6 +5,14 @@
  */
 
 
+#ifndef _NGX_GCC_ATOMIC_AMD64_H_INCLUDED_
+#define _NGX_GCC_ATOMIC_AMD64_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 #if (NGX_SMP)
 #define NGX_SMP_LOCK  "lock;"
 #else
@@ -80,3 +88,6 @@ ngx_atomic_fetch_add(ngx_atomic_t *value
 #define ngx_memory_barrier()    __asm__ volatile ("" ::: "memory")
 
 #define ngx_cpu_pause()         __asm__ ("pause")
+
+
+#endif /* _NGX_GCC_ATOMIC_AMD64_H_INCLUDED_ */
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_gcc_atomic_ppc.h
--- a/src/os/unix/ngx_gcc_atomic_ppc.h
+++ b/src/os/unix/ngx_gcc_atomic_ppc.h
@@ -5,6 +5,14 @@
  */
 
 
+#ifndef _NGX_GCC_ATOMIC_PPC_H_INCLUDED_
+#define _NGX_GCC_ATOMIC_PPC_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 /*
  * The ppc assembler treats ";" as comment, so we have to use "\n".
  * The minus in "bne-" is a hint for the branch prediction unit that
@@ -153,3 +161,6 @@ ngx_atomic_fetch_add(ngx_atomic_t *value
 
 
 #define ngx_cpu_pause()
+
+
+#endif /* _NGX_GCC_ATOMIC_PPC_H_INCLUDED_ */
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_gcc_atomic_sparc64.h
--- a/src/os/unix/ngx_gcc_atomic_sparc64.h
+++ b/src/os/unix/ngx_gcc_atomic_sparc64.h
@@ -5,6 +5,14 @@
  */
 
 
+#ifndef _NGX_GCC_ATOMIC_SPARC64_H_INCLUDED_
+#define _NGX_GCC_ATOMIC_SPARC64_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 /*
  * "casa   [r1] 0x80, r2, r0"  and
  * "casxa  [r1] 0x80, r2, r0"  do the following:
@@ -80,3 +88,6 @@ ngx_atomic_fetch_add(ngx_atomic_t *value
 #endif
 
 #define ngx_cpu_pause()
+
+
+#endif /* _NGX_GCC_ATOMIC_SPARC64_H_INCLUDED_ */
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_gcc_atomic_x86.h
--- a/src/os/unix/ngx_gcc_atomic_x86.h
+++ b/src/os/unix/ngx_gcc_atomic_x86.h
@@ -5,6 +5,14 @@
  */
 
 
+#ifndef _NGX_GCC_ATOMIC_X86_H_INCLUDED_
+#define _NGX_GCC_ATOMIC_X86_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 #if (NGX_SMP)
 #define NGX_SMP_LOCK  "lock;"
 #else
@@ -125,3 +133,6 @@ ngx_atomic_fetch_add(ngx_atomic_t *value
 
 /* old "as" does not support "pause" opcode */
 #define ngx_cpu_pause()         __asm__ (".byte 0xf3, 0x90")
+
+
+#endif /* _NGX_GCC_ATOMIC_X86_H_INCLUDED_ */
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_linux.h
--- a/src/os/unix/ngx_linux.h
+++ b/src/os/unix/ngx_linux.h
@@ -9,6 +9,10 @@
 #define _NGX_LINUX_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 ngx_chain_t *ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in,
     off_t limit);
 
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_process.h
--- a/src/os/unix/ngx_process.h
+++ b/src/os/unix/ngx_process.h
@@ -9,6 +9,8 @@
 #define _NGX_PROCESS_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
 #include <ngx_setaffinity.h>
 #include <ngx_setproctitle.h>
 
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_setaffinity.h
--- a/src/os/unix/ngx_setaffinity.h
+++ b/src/os/unix/ngx_setaffinity.h
@@ -7,6 +7,10 @@
 #define _NGX_SETAFFINITY_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 #if (NGX_HAVE_SCHED_SETAFFINITY || NGX_HAVE_CPUSET_SETAFFINITY)
 
 #define NGX_HAVE_CPU_AFFINITY 1
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_setproctitle.h
--- a/src/os/unix/ngx_setproctitle.h
+++ b/src/os/unix/ngx_setproctitle.h
@@ -9,6 +9,10 @@
 #define _NGX_SETPROCTITLE_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 #if (NGX_HAVE_SETPROCTITLE)
 
 /* FreeBSD, NetBSD, OpenBSD */
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_socket.h
--- a/src/os/unix/ngx_socket.h
+++ b/src/os/unix/ngx_socket.h
@@ -10,6 +10,7 @@
 
 
 #include <ngx_config.h>
+#include <ngx_core.h>
 
 
 #define NGX_WRITE_SHUTDOWN SHUT_WR
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_solaris.h
--- a/src/os/unix/ngx_solaris.h
+++ b/src/os/unix/ngx_solaris.h
@@ -9,6 +9,10 @@
 #define _NGX_SOLARIS_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in,
     off_t limit);
 
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/unix/ngx_sunpro_atomic_sparc64.h
--- a/src/os/unix/ngx_sunpro_atomic_sparc64.h
+++ b/src/os/unix/ngx_sunpro_atomic_sparc64.h
@@ -5,6 +5,14 @@
  */
 
 
+#ifndef _NGX_SUNPRO_ATOMIC_SPARC64_H_INCLUDED_
+#define _NGX_SUNPRO_ATOMIC_SPARC64_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 #if (NGX_PTR_SIZE == 4)
 #define NGX_CASA  ngx_casa
 #else
@@ -59,3 +67,6 @@ ngx_atomic_fetch_add(ngx_atomic_t *value
         __asm (".nonvolatile")
 
 #define ngx_cpu_pause()
+
+
+#endif /* _NGX_SUNPRO_ATOMIC_SPARC64_H_INCLUDED_ */
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/win32/ngx_process.h
--- a/src/os/win32/ngx_process.h
+++ b/src/os/win32/ngx_process.h
@@ -9,6 +9,10 @@
 #define _NGX_PROCESS_H_INCLUDED_
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
 typedef DWORD               ngx_pid_t;
 #define NGX_INVALID_PID     0
 
diff -r cfc3cfa434ec -r 863f4a52ae07 src/os/win32/ngx_service.c
--- a/src/os/win32/ngx_service.c
+++ b/src/os/win32/ngx_service.c
@@ -5,6 +5,9 @@
  */
 
 
+#include <ngx_config.h>
+#include <ngx_core.h>
+
 
 #define NGX_SERVICE_CONTROL_SHUTDOWN   128
 #define NGX_SERVICE_CONTROL_REOPEN     129



More information about the nginx-devel mailing list