]> git.kaiwu.me - njs.git/commitdiff
Merging njs_alignment.h into njs_clang.h.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 1 Aug 2019 15:49:29 +0000 (18:49 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 1 Aug 2019 15:49:29 +0000 (18:49 +0300)
src/njs_alignment.h [deleted file]
src/njs_clang.h
src/njs_main.h
src/njs_mp.c

diff --git a/src/njs_alignment.h b/src/njs_alignment.h
deleted file mode 100644 (file)
index 0c57670..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) NGINX, Inc.
- */
-
-#ifndef _NJS_ALIGNMENT_H_INCLUDED_
-#define _NJS_ALIGNMENT_H_INCLUDED_
-
-
-#ifndef NJS_MAX_ALIGNMENT
-
-#if (NJS_SOLARIS)
-/* x86_64: 16, i386: 4, sparcv9: 16, sparcv8: 8. */
-#define NJS_MAX_ALIGNMENT  _MAX_ALIGNMENT
-
-#elif (NJS_WINDOWS)
-/* Win64: 16, Win32: 8. */
-#define NJS_MAX_ALIGNMENT  MEMORY_ALLOCATION_ALIGNMENT
-
-#elif (__amd64__)
-#define NJS_MAX_ALIGNMENT  16
-
-#elif (__i386__ || __i386)
-#define NJS_MAX_ALIGNMENT  4
-
-#elif (__arm__)
-#define NJS_MAX_ALIGNMENT  16
-
-#else
-#define NJS_MAX_ALIGNMENT  16
-#endif
-
-#endif
-
-
-#define njs_align_size(size, a)                                               \
-    (((size) + ((size_t) (a) - 1)) & ~((size_t) (a) - 1))
-
-
-#define njs_align_ptr(p, a)                                                   \
-    (u_char *) (((uintptr_t) (p) + ((uintptr_t) (a) - 1))                     \
-                 & ~((uintptr_t) (a) - 1))
-
-#define njs_trunc_ptr(p, a)                                                   \
-    (u_char *) ((uintptr_t) (p) & ~((uintptr_t) (a) - 1))
-
-
-#endif /* _NJS_ALIGNMENT_H_INCLUDED_ */
index bbc81f05cf2926dd57cf89921086029575c1a3a2..3356ec19f0df37a15ee725e64a6e6b3f95ab5ebb 100644 (file)
@@ -157,4 +157,42 @@ njs_leading_zeros64(uint64_t x)
 #endif
 
 
+#ifndef NJS_MAX_ALIGNMENT
+
+#if (NJS_SOLARIS)
+/* x86_64: 16, i386: 4, sparcv9: 16, sparcv8: 8. */
+#define NJS_MAX_ALIGNMENT  _MAX_ALIGNMENT
+
+#elif (NJS_WINDOWS)
+/* Win64: 16, Win32: 8. */
+#define NJS_MAX_ALIGNMENT  MEMORY_ALLOCATION_ALIGNMENT
+
+#elif (__amd64__)
+#define NJS_MAX_ALIGNMENT  16
+
+#elif (__i386__ || __i386)
+#define NJS_MAX_ALIGNMENT  4
+
+#elif (__arm__)
+#define NJS_MAX_ALIGNMENT  16
+
+#else
+#define NJS_MAX_ALIGNMENT  16
+#endif
+
+#endif
+
+
+#define njs_align_size(size, a)                                               \
+    (((size) + ((size_t) (a) - 1)) & ~((size_t) (a) - 1))
+
+
+#define njs_align_ptr(p, a)                                                   \
+    (u_char *) (((uintptr_t) (p) + ((uintptr_t) (a) - 1))                     \
+                 & ~((uintptr_t) (a) - 1))
+
+#define njs_trunc_ptr(p, a)                                                   \
+    (u_char *) ((uintptr_t) (p) & ~((uintptr_t) (a) - 1))
+
+
 #endif /* _NJS_CLANG_H_INCLUDED_ */
index 77803a0812400a412d33495c94aca96d88169ce3..499683b90535b3213cfe38f2d226bc52bb10bfa8 100644 (file)
@@ -13,7 +13,6 @@
 #include <njs_unix.h>
 #include <njs_types.h>
 #include <njs_clang.h>
-#include <njs_alignment.h>
 #include <njs_str.h>
 #include <njs_stub.h>
 #include <njs_utf8.h>
index 117002f99961bc67197ca2dd9eb2132ab80e99db..c3e24b4f923c123a1c5837068f0a93b571cd59ba 100644 (file)
@@ -7,7 +7,6 @@
 #include <njs_auto_config.h>
 #include <njs_types.h>
 #include <njs_clang.h>
-#include <njs_alignment.h>
 #include <njs_stub.h>
 #include <njs_str.h>
 #include <njs_queue.h>