]> granicus.if.org Git - strace/commitdiff
Unify usage of #include guards
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 7 Aug 2016 03:44:19 +0000 (06:44 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 8 Aug 2016 09:54:01 +0000 (09:54 +0000)
This commit is an attempt to unify usage of include guards (in top-level
headers, at least).  As a side note, different files with *.h extension
have different semantics: for example, printargs.h is included multiple
times in order to generate slightly varying code depending on values of
macro definitions - maybe it's better to change extension of such files
to something like *.inc.

* defs.h: Add #include guard.
* flock.h: Likewise.
* ipc_defs.h: Likewise.
* mpers_type.h: Likewise.
* printsiginfo.h: Likewise.
* ptrace.h: Likewise.
* regs.h: Likewise.
* seccomp_fprog.h: Likewise.
* gcc_compat.h: Rename the macro used for #include guard.
* msghdr.h: Likewise.
* sigevent.h: Likewise.
* kernel_types.h: Comment the trailing part of #include guard.
* xlat.h: Add missing macro definition for #include guard.

13 files changed:
defs.h
flock.h
gcc_compat.h
ipc_defs.h
kernel_types.h
mpers_type.h
msghdr.h
printsiginfo.h
ptrace.h
regs.h
seccomp_fprog.h
sigevent.h
xlat.h

diff --git a/defs.h b/defs.h
index bfe76e2d3b739bcf091724c724c847ef918ebcd7..eabce52c995d4828fb7684fea4a3531ca3c3386b 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -27,6 +27,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef STRACE_DEFS_H
+#define STRACE_DEFS_H
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -901,3 +904,5 @@ extern unsigned num_quals;
 #define PRI__d64 PRI__64"d"
 #define PRI__u64 PRI__64"u"
 #define PRI__x64 PRI__64"x"
+
+#endif /* #ifndef STRACE_DEFS_H */
diff --git a/flock.h b/flock.h
index b1ab8ff30875c72a8b5bb69f1ba839e9a10c2d80..b438ea5bd86217b455b652ede007376faf5a4dff 100644 (file)
--- a/flock.h
+++ b/flock.h
@@ -25,6 +25,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef STRACE_FLOCK_H
+#define STRACE_FLOCK_H
+
 #include <linux/fcntl.h>
 
 #if defined HAVE_STRUCT_FLOCK
@@ -42,3 +45,5 @@ typedef struct __kernel_flock64 struct_kernel_flock64;
 #else
 # error struct flock64 definition not found in <linux/fcntl.h>
 #endif
+
+#endif /* #ifndef STRACE_FLOCK_H */
index c06d3c1d0d0ca205d58d3e47c38752cfa30e57c9..0f76fbbfaf2f9f40cd72125f07fcd5ce74d08725 100644 (file)
@@ -25,8 +25,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef GCC_COMPAT_H_
-#define GCC_COMPAT_H_
+#ifndef STRACE_GCC_COMPAT_H
+#define STRACE_GCC_COMPAT_H
 
 #if defined __GNUC__ && defined __GNUC_MINOR__
 # define GNUC_PREREQ(maj, min) \
@@ -76,4 +76,4 @@
 # define ATTRIBUTE_ALLOC_SIZE(args)    /* empty */
 #endif
 
-#endif
+#endif /* #ifndef STRACE_GCC_COMPAT_H */
index b6c85c1aa53ca6f2501e9b7a2603eceb7286aeac..0ece103188dbd2a5512e9a1e7fbee114f78b879d 100644 (file)
@@ -25,6 +25,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef STRACE_IPC_DEFS_H
+#define STRACE_IPC_DEFS_H
+
 #ifdef HAVE_SYS_IPC_H
 # include <sys/ipc.h>
 #elif defined HAVE_LINUX_IPC_H
@@ -40,3 +43,5 @@
 #define PRINTCTL(flagset, arg, dflt) \
        if ((arg) & IPC_64) tprints("IPC_64|"); \
        printxval((flagset), (arg) &~ IPC_64, dflt)
+
+#endif /* #ifndef STRACE_IPC_DEFS_H */
index 3dee7618c7c4829103e00a9298e49fbdd61156d4..47fbff4663fd1103e417dc333975f186fcc1974a 100644 (file)
@@ -26,8 +26,7 @@
  */
 
 #ifndef STRACE_KERNEL_TYPES_H
-
-# define STRACE_KERNEL_TYPES_H
+#define STRACE_KERNEL_TYPES_H
 
 # if defined HAVE___KERNEL_LONG_T && defined HAVE___KERNEL_ULONG_T
 
@@ -55,4 +54,4 @@ typedef struct {
        char            d_name[1];
 } kernel_dirent;
 
-#endif
+#endif /* #ifndef STRACE_KERNEL_TYPES_H */
index 4ce569bb3fc75b24f09d6372d45259627c1590cb..f9bb2c5decac56778eeea3d48cd868bda9c56fd9 100644 (file)
@@ -26,6 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef STRACE_MPERS_TYPE_H
+#define STRACE_MPERS_TYPE_H
+
 #ifdef IN_MPERS
 # define STRINGIFY(a) #a
 # define DEF_MPERS_TYPE(args) STRINGIFY(args.h)
@@ -45,3 +48,5 @@
 #  define MPERS_DEFS "native_defs.h"
 # endif
 #endif
+
+#endif /* #ifndef STRACE_MPERS_TYPE_H */
index 41a07d70f04570640fc80ad8a817b7d7e317c0a1..b56fe61be933e6bac58c0f634520237e045e7696 100644 (file)
--- a/msghdr.h
+++ b/msghdr.h
@@ -1,5 +1,5 @@
-#ifndef MSGHDR_H_
-# define MSGHDR_H_
+#ifndef STRACE_MSGHDR_H
+#define STRACE_MSGHDR_H
 
 /* For definitions of struct msghdr and struct mmsghdr. */
 # include <sys/socket.h>
@@ -14,4 +14,4 @@ struct mmsghdr {
 struct tcb;
 extern void print_struct_msghdr(struct tcb *, const struct msghdr *, const int *, unsigned long);
 
-#endif /* MSGHDR_H_ */
+#endif /* #ifndef STRACE_MSGHDR_H */
index cb2d99d7e2adcf308b67a7492eff5c66ccc11765..f2dd62f9673ec5ac05de6e9afb3841d566cd5c4e 100644 (file)
@@ -1 +1,6 @@
+#ifndef STRACE_PRINTSIGINFO_H
+#define STRACE_PRINTSIGINFO_H
+
 extern void printsiginfo(const siginfo_t *);
+
+#endif /* #ifndef STRACE_PRINTSIGINFO_H */
index 2e7d5e32b63c86e9018e4115669f4021ff09d8d7..aba61b79c39a0db4250366e3da030cecbfad6530 100644 (file)
--- a/ptrace.h
+++ b/ptrace.h
@@ -33,6 +33,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef STRACE_PTRACE_H
+#define STRACE_PTRACE_H
+
 #ifdef NEED_PTRACE_PROTOTYPE_WORKAROUND
 # define ptrace xptrace
 # include <sys/ptrace.h>
@@ -172,3 +175,5 @@ extern long ptrace(int, int, char *, long);
 #if !HAVE_DECL_PTRACE_POKEUSER
 # define PTRACE_POKEUSER PTRACE_POKEUSR
 #endif
+
+#endif /* #ifndef STRACE_PTRACE_H */
diff --git a/regs.h b/regs.h
index 9b0746cdbc3551f62382991e030ca46738ab74f2..7bf43055891c80f99616e6f9e3ff02aebeeb59a4 100644 (file)
--- a/regs.h
+++ b/regs.h
@@ -1,3 +1,6 @@
+#ifndef STRACE_REGS_H
+#define STRACE_REGS_H
+
 #include <sys/user.h>
 
 #ifdef HAVE_SYS_REG_H
@@ -5,3 +8,5 @@
 #endif
 
 #include "arch_regs.h"
+
+#endif /* #ifndef STRACE_REGS_H */
index 6b1f77ffcebe22db856c5d28112ef1b0305237ab..f72107250831c484fdc01c6825324b0eeed8ff7e 100644 (file)
@@ -1,4 +1,9 @@
+#ifndef STRACE_SECCOMP_FPROG_H
+#define STRACE_SECCOMP_FPROG_H
+
 struct seccomp_fprog {
        unsigned short len;
        unsigned long filter;
 };
+
+#endif /* #ifndef STRACE_SECCOMP_FPROG_H */
index 6b3bacfb1edba7cdcfa1b6a66b0af4f627a5f7e7..89b85226b8fbdefc2317bdcfe15849728a3d0af1 100644 (file)
@@ -25,8 +25,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef SIGEVENT_H_
-#define SIGEVENT_H_
+#ifndef STRACE_SIGEVENT_H
+#define STRACE_SIGEVENT_H
 
 typedef struct {
        union {
@@ -44,4 +44,4 @@ typedef struct {
        } sigev_un;
 } struct_sigevent;
 
-#endif
+#endif /* #ifndef STRACE_SIGEVENT_H */
diff --git a/xlat.h b/xlat.h
index 2f7643cadf9c291b7ad8654fd25f7da0681bb8e4..c8073b83ae16928620adcaa41cb4a445e50c5241 100644 (file)
--- a/xlat.h
+++ b/xlat.h
@@ -1,4 +1,5 @@
 #ifndef STRACE_XLAT_H
+#define STRACE_XLAT_H
 
 # include <stdint.h>
 
@@ -13,4 +14,4 @@ struct xlat {
 # define XLAT_TYPE_PAIR(type, val, str)        {     (type)(val), str  }
 # define XLAT_END                      {               0, 0    }
 
-#endif
+#endif /* #ifndef STRACE_XLAT_H */