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 /includes/stg | |
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 'includes/stg')
-rw-r--r-- | includes/stg/DLL.h | 5 | ||||
-rw-r--r-- | includes/stg/HaskellMachRegs.h | 5 | ||||
-rw-r--r-- | includes/stg/MachRegs.h | 5 | ||||
-rw-r--r-- | includes/stg/MiscClosures.h | 5 | ||||
-rw-r--r-- | includes/stg/Prim.h | 5 | ||||
-rw-r--r-- | includes/stg/Regs.h | 5 | ||||
-rw-r--r-- | includes/stg/RtsMachRegs.h | 5 | ||||
-rw-r--r-- | includes/stg/SMP.h | 5 | ||||
-rw-r--r-- | includes/stg/Ticky.h | 6 | ||||
-rw-r--r-- | includes/stg/Types.h | 5 |
10 files changed, 10 insertions, 41 deletions
diff --git a/includes/stg/DLL.h b/includes/stg/DLL.h index 8ab5d8c3d4..cf857a8682 100644 --- a/includes/stg/DLL.h +++ b/includes/stg/DLL.h @@ -11,8 +11,7 @@ * * ---------------------------------------------------------------------------*/ -#ifndef __STGDLL_H__ -#define __STGDLL_H__ 1 +#pragma once #if defined(COMPILING_WINDOWS_DLL) # if defined(x86_64_HOST_ARCH) @@ -71,5 +70,3 @@ #else #define DLL_IMPORT_STDLIB DLLIMPORT #endif - -#endif /* __STGDLL_H__ */ diff --git a/includes/stg/HaskellMachRegs.h b/includes/stg/HaskellMachRegs.h index e95cefd822..37e687bc4e 100644 --- a/includes/stg/HaskellMachRegs.h +++ b/includes/stg/HaskellMachRegs.h @@ -12,8 +12,7 @@ * * ---------------------------------------------------------------------------*/ -#ifndef HASKELLMACHREGS_H -#define HASKELLMACHREGS_H +#pragma once /* * Defining NO_REGS causes no global registers to be used. NO_REGS is @@ -45,5 +44,3 @@ #endif #include "MachRegs.h" - -#endif /* HASKELLMACHREGS_H */ diff --git a/includes/stg/MachRegs.h b/includes/stg/MachRegs.h index 232ce03810..a0cf595505 100644 --- a/includes/stg/MachRegs.h +++ b/includes/stg/MachRegs.h @@ -12,8 +12,7 @@ * * ---------------------------------------------------------------------------*/ -#ifndef MACHREGS_H -#define MACHREGS_H +#pragma once /* This file is #included into Haskell code in the compiler: #defines * only in here please. @@ -714,5 +713,3 @@ the stack. See Note [Overlapping global registers] for implications. #else #undef NO_ARG_REGS #endif - -#endif /* MACHREGS_H */ diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index 9d907ab3ba..1181abcca4 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -17,8 +17,7 @@ * * --------------------------------------------------------------------------*/ -#ifndef STGMISCCLOSURES_H -#define STGMISCCLOSURES_H +#pragma once #if IN_STG_CODE # define RTS_RET_INFO(i) extern W_(i)[] @@ -532,5 +531,3 @@ void * pushCostCentre (void *ccs, void *cc); extern unsigned int n_capabilities; #endif - -#endif /* STGMISCCLOSURES_H */ diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h index 9872512701..fa3a3ec91f 100644 --- a/includes/stg/Prim.h +++ b/includes/stg/Prim.h @@ -11,8 +11,7 @@ * * -------------------------------------------------------------------------- */ -#ifndef PRIM_H -#define PRIM_H +#pragma once /* libraries/ghc-prim/cbits/atomic.c */ StgWord hs_atomic_add8(StgWord x, StgWord val); @@ -81,5 +80,3 @@ StgWord hs_ctz8(StgWord x); StgWord hs_ctz16(StgWord x); StgWord hs_ctz32(StgWord x); StgWord hs_ctz64(StgWord64 x); - -#endif /* PRIM_H */ diff --git a/includes/stg/Regs.h b/includes/stg/Regs.h index 36324632d2..cf9e306504 100644 --- a/includes/stg/Regs.h +++ b/includes/stg/Regs.h @@ -11,8 +11,7 @@ * * ---------------------------------------------------------------------------*/ -#ifndef REGS_H -#define REGS_H +#pragma once /* * The STG machine has a collection of "registers", each one of which @@ -527,5 +526,3 @@ GLOBAL_REG_DECL(bdescr *,HpAlloc,REG_HpAlloc) #define stg_gc_fun (FunReg->stgGCFun) #endif /* IN_STG_CODE */ - -#endif /* REGS_H */ diff --git a/includes/stg/RtsMachRegs.h b/includes/stg/RtsMachRegs.h index 29262dc17a..5a0464b909 100644 --- a/includes/stg/RtsMachRegs.h +++ b/includes/stg/RtsMachRegs.h @@ -12,8 +12,7 @@ * * ---------------------------------------------------------------------------*/ -#ifndef RTSMACHREGS_H -#define RTSMACHREGS_H +#pragma once #ifdef UnregisterisedCompiler #ifndef NO_REGS @@ -51,5 +50,3 @@ #endif #include "MachRegs.h" - -#endif /* RTSMACHREGS_H */ diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h index 0e806b6716..e4ae6121fa 100644 --- a/includes/stg/SMP.h +++ b/includes/stg/SMP.h @@ -11,8 +11,7 @@ * * -------------------------------------------------------------------------- */ -#ifndef SMP_H -#define SMP_H +#pragma once #if arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv6) void arm_atomic_spin_lock(void); @@ -299,5 +298,3 @@ atomic_dec(StgVolatilePtr p) #define VOLATILE_LOAD(p) ((StgWord)*((StgWord*)(p))) #endif /* !THREADED_RTS */ - -#endif /* SMP_H */ diff --git a/includes/stg/Ticky.h b/includes/stg/Ticky.h index 5143c2fd5c..1e16a1ae08 100644 --- a/includes/stg/Ticky.h +++ b/includes/stg/Ticky.h @@ -11,8 +11,7 @@ * * -------------------------------------------------------------------------- */ -#ifndef TICKYCOUNTERS_H -#define TICKYCOUNTERS_H +#pragma once /* These should probably be automatically generated in order to keep them consistent with the macros that use them (which are @@ -215,6 +214,3 @@ EXTERN StgInt RET_UNBOXED_TUP_hst[TICKY_BIN_COUNT] INIT({0}); #define TICK_ALLOC_SE_THK(g,s) #endif - - -#endif /* TICKYCOUNTERS_H */ diff --git a/includes/stg/Types.h b/includes/stg/Types.h index 3a08eb2f85..af6a51791c 100644 --- a/includes/stg/Types.h +++ b/includes/stg/Types.h @@ -18,8 +18,7 @@ * * ---------------------------------------------------------------------------*/ -#ifndef STGTYPES_H -#define STGTYPES_H +#pragma once #if defined(mingw32_HOST_OS) /* Inform mingw we want the ISO rather than Windows printf format specifiers. */ @@ -182,5 +181,3 @@ typedef StgWord8* StgByteArray; typedef void *(*(*StgFunPtr)(void))(void); typedef StgFunPtr StgFun(void); - -#endif /* STGTYPES_H */ |