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 /compiler | |
| 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 'compiler')
| -rw-r--r-- | compiler/HsVersions.h | 6 | ||||
| -rw-r--r-- | compiler/nativeGen/NCG.h | 5 | ||||
| -rw-r--r-- | compiler/utils/md5.h | 8 |
3 files changed, 3 insertions, 16 deletions
diff --git a/compiler/HsVersions.h b/compiler/HsVersions.h index 4a0b04ad70..a4ec3e4c40 100644 --- a/compiler/HsVersions.h +++ b/compiler/HsVersions.h @@ -1,5 +1,4 @@ -#ifndef HSVERSIONS_H -#define HSVERSIONS_H +#pragma once #if 0 @@ -64,6 +63,3 @@ foreign import ccall unsafe saccessor \ #define ASSERTM(e) do { bool <- e; MASSERT(bool) } #define ASSERTM2(e,msg) do { bool <- e; MASSERT2(bool,msg) } #define WARNM2(e,msg) do { bool <- e; WARN(bool, msg) return () } - -#endif /* HsVersions.h */ - diff --git a/compiler/nativeGen/NCG.h b/compiler/nativeGen/NCG.h index bca1de41e3..e7e20768b6 100644 --- a/compiler/nativeGen/NCG.h +++ b/compiler/nativeGen/NCG.h @@ -6,9 +6,6 @@ -------------------------------------------------------------------------- */ -#ifndef NCG_H -#define NCG_H +#pragma once #include "ghc_boot_platform.h" - -#endif diff --git a/compiler/utils/md5.h b/compiler/utils/md5.h index 10c8dabd43..0b31f9019c 100644 --- a/compiler/utils/md5.h +++ b/compiler/utils/md5.h @@ -1,6 +1,5 @@ /* MD5 message digest */ -#ifndef _MD5_H -#define _MD5_H +#pragma once #include "HsFFI.h" @@ -17,8 +16,3 @@ void MD5Init(struct MD5Context *context); void MD5Update(struct MD5Context *context, byte const *buf, int len); void MD5Final(byte digest[16], struct MD5Context *context); void MD5Transform(word32 buf[4], word32 const in[16]); - -#endif /* _MD5_H */ - - - |
