diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-04-22 09:34:18 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-23 11:05:48 -0400 |
commit | f13eebcc9b1407e5aeaf010536fcb5e469dbfe71 (patch) | |
tree | 99bb45d293b74ba0570a2555e07fed09f8c3f659 /rts/linker | |
parent | 87fbf39a61d2535a172fbcecec098730eba1777f (diff) | |
download | haskell-f13eebcc9b1407e5aeaf010536fcb5e469dbfe71.tar.gz |
cpp: Use #pragma once instead of #ifndef guards
This both says what we mean and silences a bunch of spurious CPP linting
warnings. This pragma is supported by all CPP implementations which we
support.
Reviewers: austin, erikd, simonmar, hvr
Reviewed By: simonmar
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3482
Diffstat (limited to 'rts/linker')
-rw-r--r-- | rts/linker/CacheFlush.h | 5 | ||||
-rw-r--r-- | rts/linker/Elf.h | 5 | ||||
-rw-r--r-- | rts/linker/M32Alloc.h | 5 | ||||
-rw-r--r-- | rts/linker/MachO.h | 5 | ||||
-rw-r--r-- | rts/linker/MachOTypes.h | 4 | ||||
-rw-r--r-- | rts/linker/PEi386.h | 5 | ||||
-rw-r--r-- | rts/linker/SymbolExtras.h | 5 |
7 files changed, 7 insertions, 27 deletions
diff --git a/rts/linker/CacheFlush.h b/rts/linker/CacheFlush.h index f4d939d21e..aa081cca29 100644 --- a/rts/linker/CacheFlush.h +++ b/rts/linker/CacheFlush.h @@ -1,5 +1,4 @@ -#ifndef CACHE_FLUSH_H -#define CACHE_FLUSH_H +#pragma once #include "LinkerInternals.h" @@ -8,5 +7,3 @@ void ocFlushInstructionCache( ObjectCode *oc ); #include "EndPrivate.h" - -#endif /* CACHE_FLUSH_H */ diff --git a/rts/linker/Elf.h b/rts/linker/Elf.h index 0c33130122..57ec46e146 100644 --- a/rts/linker/Elf.h +++ b/rts/linker/Elf.h @@ -1,5 +1,4 @@ -#ifndef LINKER_ELF_H -#define LINKER_ELF_H +#pragma once #include "Rts.h" #include "LinkerInternals.h" @@ -13,5 +12,3 @@ int ocRunInit_ELF ( ObjectCode* oc ); int ocAllocateSymbolExtras_ELF( ObjectCode *oc ); #include "EndPrivate.h" - -#endif /* LINKER_ELF_H */ diff --git a/rts/linker/M32Alloc.h b/rts/linker/M32Alloc.h index 8ec49cae21..e71f500e08 100644 --- a/rts/linker/M32Alloc.h +++ b/rts/linker/M32Alloc.h @@ -6,8 +6,7 @@ * * ---------------------------------------------------------------------------*/ -#ifndef RTS_LINKER_M32ALLOC -#define RTS_LINKER_M32ALLOC +#pragma once #if RTS_LINKER_USE_MMAP #include <fcntl.h> @@ -36,5 +35,3 @@ void m32_free(void *addr, size_t size) M32_NO_RETURN; void * m32_alloc(size_t size, size_t alignment) M32_NO_RETURN; #include "EndPrivate.h" - -#endif diff --git a/rts/linker/MachO.h b/rts/linker/MachO.h index 9362eb7238..c07e2944a1 100644 --- a/rts/linker/MachO.h +++ b/rts/linker/MachO.h @@ -1,5 +1,4 @@ -#ifndef LINKER_MACHO_H -#define LINKER_MACHO_H +#pragma once #include "Rts.h" @@ -21,5 +20,3 @@ void machoInitSymbolsWithoutUnderscore( void ); #endif #include "EndPrivate.h" - -#endif /* LINKER_MACHO_H */ diff --git a/rts/linker/MachOTypes.h b/rts/linker/MachOTypes.h index 5b2dced81b..b7ee7e2ed7 100644 --- a/rts/linker/MachOTypes.h +++ b/rts/linker/MachOTypes.h @@ -1,5 +1,4 @@ -#ifndef MachOTypes_h -#define MachOTypes_h +#pragma once #if defined(OBJFORMAT_MACHO) @@ -130,4 +129,3 @@ typedef struct _SectionFormatInfo { } SectionFormatInfo; #endif /* OBJECTFORMAT_MACHO */ -#endif /* MachOTypes_h */ diff --git a/rts/linker/PEi386.h b/rts/linker/PEi386.h index 09b8c91c94..b034d6c7c9 100644 --- a/rts/linker/PEi386.h +++ b/rts/linker/PEi386.h @@ -1,5 +1,4 @@ -#ifndef LINKER_PE_I386_H -#define LINKER_PE_I386_H +#pragma once #include "Rts.h" #include "LinkerInternals.h" @@ -107,5 +106,3 @@ See #9218 #include "EndPrivate.h" - -#endif /* LINKER_PE_I386_H */ diff --git a/rts/linker/SymbolExtras.h b/rts/linker/SymbolExtras.h index 25cb022ab0..d28baf49df 100644 --- a/rts/linker/SymbolExtras.h +++ b/rts/linker/SymbolExtras.h @@ -1,5 +1,4 @@ -#ifndef LINKER_SYMBOL_EXTRAS_H -#define LINKER_SYMBOL_EXTRAS_H +#pragma once #include "Rts.h" #include "LinkerInternals.h" @@ -26,5 +25,3 @@ SymbolExtra* makeSymbolExtra( ObjectCode const* oc, #endif /* NEED_SYMBOL_EXTRAS */ #include "EndPrivate.h" - -#endif /* LINKER_SYMBOL_EXTRAS_H */ |