summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-04-22 09:34:18 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-23 11:05:48 -0400
commitf13eebcc9b1407e5aeaf010536fcb5e469dbfe71 (patch)
tree99bb45d293b74ba0570a2555e07fed09f8c3f659 /includes
parent87fbf39a61d2535a172fbcecec098730eba1777f (diff)
downloadhaskell-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')
-rw-r--r--includes/Cmm.h5
-rw-r--r--includes/HsFFI.h5
-rw-r--r--includes/MachDeps.h5
-rw-r--r--includes/Rts.h5
-rw-r--r--includes/RtsAPI.h5
-rw-r--r--includes/Stg.h5
-rw-r--r--includes/ghcconfig.h5
-rw-r--r--includes/rts/Adjustor.h5
-rw-r--r--includes/rts/BlockSignals.h5
-rw-r--r--includes/rts/Config.h5
-rw-r--r--includes/rts/Constants.h5
-rw-r--r--includes/rts/EventLogFormat.h5
-rw-r--r--includes/rts/EventLogWriter.h5
-rw-r--r--includes/rts/FileLock.h5
-rw-r--r--includes/rts/Flags.h5
-rw-r--r--includes/rts/GetTime.h5
-rw-r--r--includes/rts/Globals.h5
-rw-r--r--includes/rts/Hpc.h5
-rw-r--r--includes/rts/IOManager.h5
-rw-r--r--includes/rts/Libdw.h7
-rw-r--r--includes/rts/LibdwPool.h5
-rw-r--r--includes/rts/Linker.h5
-rw-r--r--includes/rts/Main.h5
-rw-r--r--includes/rts/Messages.h5
-rw-r--r--includes/rts/OSThreads.h5
-rw-r--r--includes/rts/Parallel.h5
-rw-r--r--includes/rts/PrimFloat.h5
-rw-r--r--includes/rts/Signals.h5
-rw-r--r--includes/rts/SpinLock.h8
-rw-r--r--includes/rts/Stable.h5
-rw-r--r--includes/rts/StaticPtrTable.h5
-rw-r--r--includes/rts/TTY.h5
-rw-r--r--includes/rts/Threads.h5
-rw-r--r--includes/rts/Ticky.h5
-rw-r--r--includes/rts/Time.h5
-rw-r--r--includes/rts/Timer.h5
-rw-r--r--includes/rts/Types.h5
-rw-r--r--includes/rts/Utils.h5
-rw-r--r--includes/rts/prof/CCS.h5
-rw-r--r--includes/rts/prof/LDV.h5
-rw-r--r--includes/rts/storage/Block.h4
-rw-r--r--includes/rts/storage/ClosureMacros.h5
-rw-r--r--includes/rts/storage/ClosureTypes.h5
-rw-r--r--includes/rts/storage/Closures.h6
-rw-r--r--includes/rts/storage/FunTypes.h5
-rw-r--r--includes/rts/storage/GC.h5
-rw-r--r--includes/rts/storage/InfoTables.h5
-rw-r--r--includes/rts/storage/MBlock.h5
-rw-r--r--includes/rts/storage/TSO.h5
-rw-r--r--includes/stg/DLL.h5
-rw-r--r--includes/stg/HaskellMachRegs.h5
-rw-r--r--includes/stg/MachRegs.h5
-rw-r--r--includes/stg/MiscClosures.h5
-rw-r--r--includes/stg/Prim.h5
-rw-r--r--includes/stg/Regs.h5
-rw-r--r--includes/stg/RtsMachRegs.h5
-rw-r--r--includes/stg/SMP.h5
-rw-r--r--includes/stg/Ticky.h6
-rw-r--r--includes/stg/Types.h5
59 files changed, 60 insertions, 241 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h
index 276348a6c9..779416b6da 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -25,8 +25,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef CMM_H
-#define CMM_H
+#pragma once
/*
* In files that are included into both C and C-- (and perhaps
@@ -942,5 +941,3 @@
} \
\
return (dst);
-
-#endif /* CMM_H */
diff --git a/includes/HsFFI.h b/includes/HsFFI.h
index 53478a7a5e..bee942c44c 100644
--- a/includes/HsFFI.h
+++ b/includes/HsFFI.h
@@ -9,8 +9,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef HSFFI_H
-#define HSFFI_H
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -122,5 +121,3 @@ extern void hs_try_putmvar (int capability, HsStablePtr sp);
#ifdef __cplusplus
}
#endif
-
-#endif /* HSFFI_H */
diff --git a/includes/MachDeps.h b/includes/MachDeps.h
index 380b3fb061..778975ea3c 100644
--- a/includes/MachDeps.h
+++ b/includes/MachDeps.h
@@ -13,8 +13,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef MACHDEPS_H
-#define MACHDEPS_H
+#pragma once
/* Don't allow stage1 (cross-)compiler embed assumptions about target
* platform. When ghc-stage1 is being built by ghc-stage0 is should not
@@ -122,5 +121,3 @@
#define TAG_MASK ((1 << TAG_BITS) - 1)
#endif /* !defined(STAGE) || STAGE >= 2 */
-
-#endif /* MACHDEPS_H */
diff --git a/includes/Rts.h b/includes/Rts.h
index be49b326f2..b36fc94a5e 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -10,8 +10,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_H
-#define RTS_H
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -313,5 +312,3 @@ TICK_VAR(2)
#ifdef __cplusplus
}
#endif
-
-#endif /* RTS_H */
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h
index e5326f759b..f9b561800d 100644
--- a/includes/RtsAPI.h
+++ b/includes/RtsAPI.h
@@ -9,8 +9,7 @@
*
* --------------------------------------------------------------------------*/
-#ifndef RTSAPI_H
-#define RTSAPI_H
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -445,5 +444,3 @@ extern StgWord base_GHCziTopHandler_runNonIO_closure[];
#ifdef __cplusplus
}
#endif
-
-#endif /* RTSAPI_H */
diff --git a/includes/Stg.h b/includes/Stg.h
index 619984d8e5..ff5e3174c0 100644
--- a/includes/Stg.h
+++ b/includes/Stg.h
@@ -23,8 +23,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef STG_H
-#define STG_H
+#pragma once
#if !(__STDC_VERSION__ >= 199901L)
# error __STDC_VERSION__ does not advertise C99 or later
@@ -567,5 +566,3 @@ typedef union {
c; \
})
#endif
-
-#endif /* STG_H */
diff --git a/includes/ghcconfig.h b/includes/ghcconfig.h
index 5f10e923fd..7b99835a23 100644
--- a/includes/ghcconfig.h
+++ b/includes/ghcconfig.h
@@ -1,7 +1,4 @@
-#ifndef __GHCCONFIG_H__
-#define __GHCCONFIG_H__
+#pragma once
#include "ghcautoconf.h"
#include "ghcplatform.h"
-
-#endif
diff --git a/includes/rts/Adjustor.h b/includes/rts/Adjustor.h
index 5e96a072fb..49fd62652d 100644
--- a/includes/rts/Adjustor.h
+++ b/includes/rts/Adjustor.h
@@ -11,8 +11,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_ADJUSTOR_H
-#define RTS_ADJUSTOR_H
+#pragma once
/* Creating and destroying an adjustor thunk */
void* createAdjustor (int cconv,
@@ -21,5 +20,3 @@ void* createAdjustor (int cconv,
char *typeString);
void freeHaskellFunctionPtr (void* ptr);
-
-#endif /* RTS_ADJUSTOR_H */
diff --git a/includes/rts/BlockSignals.h b/includes/rts/BlockSignals.h
index 166d7bb3fe..23bc9859e0 100644
--- a/includes/rts/BlockSignals.h
+++ b/includes/rts/BlockSignals.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_BLOCKSIGNALS_H
-#define RTS_BLOCKSIGNALS_H
+#pragma once
/* Used by runProcess() in the process package
*/
@@ -33,5 +32,3 @@ void blockUserSignals(void);
* The inverse of blockUserSignals(); re-enable the deliver of console events.
*/
void unblockUserSignals(void);
-
-#endif /* RTS_BLOCKSIGNALS_H */
diff --git a/includes/rts/Config.h b/includes/rts/Config.h
index 51ee74fdb8..43057773f2 100644
--- a/includes/rts/Config.h
+++ b/includes/rts/Config.h
@@ -13,8 +13,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_CONFIG_H
-#define RTS_CONFIG_H
+#pragma once
#if defined(TICKY_TICKY) && defined(THREADED_RTS)
#error TICKY_TICKY is incompatible with THREADED_RTS
@@ -47,5 +46,3 @@
/* Profile spin locks */
#define PROF_SPIN
-
-#endif /* RTS_CONFIG_H */
diff --git a/includes/rts/Constants.h b/includes/rts/Constants.h
index 62fa833173..27097bf45b 100644
--- a/includes/rts/Constants.h
+++ b/includes/rts/Constants.h
@@ -17,8 +17,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_CONSTANTS_H
-#define RTS_CONSTANTS_H
+#pragma once
/* -----------------------------------------------------------------------------
Minimum closure sizes
@@ -314,5 +313,3 @@
* we can have static arrays of this size in the RTS for speed.
*/
#define MAX_NUMA_NODES 16
-
-#endif /* RTS_CONSTANTS_H */
diff --git a/includes/rts/EventLogFormat.h b/includes/rts/EventLogFormat.h
index d6838abd8a..160aa19303 100644
--- a/includes/rts/EventLogFormat.h
+++ b/includes/rts/EventLogFormat.h
@@ -73,8 +73,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_EVENTLOGFORMAT_H
-#define RTS_EVENTLOGFORMAT_H
+#pragma once
/*
* Markers for begin/end of the Header.
@@ -245,5 +244,3 @@ typedef StgWord64 EventTaskId; /* for EVENT_TASK_* */
typedef StgWord64 EventKernelThreadId; /* for EVENT_TASK_CREATE */
#endif
-
-#endif /* RTS_EVENTLOGFORMAT_H */
diff --git a/includes/rts/EventLogWriter.h b/includes/rts/EventLogWriter.h
index f9cb25fe62..829b0f2697 100644
--- a/includes/rts/EventLogWriter.h
+++ b/includes/rts/EventLogWriter.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef EVENTLOG_WRITER_H
-#define EVENTLOG_WRITER_H
+#pragma once
#include <stddef.h>
#include <stdbool.h>
@@ -36,5 +35,3 @@ typedef struct {
* a file `program.eventlog`.
*/
extern const EventLogWriter FileEventLogWriter;
-
-#endif /* EVENTLOG_WRITER_H */
diff --git a/includes/rts/FileLock.h b/includes/rts/FileLock.h
index e4c7c66fa7..8bc08141cf 100644
--- a/includes/rts/FileLock.h
+++ b/includes/rts/FileLock.h
@@ -11,12 +11,9 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_FILELOCK_H
-#define RTS_FILELOCK_H
+#pragma once
#include "Stg.h"
int lockFile(int fd, StgWord64 dev, StgWord64 ino, int for_writing);
int unlockFile(int fd);
-
-#endif /* RTS_FILELOCK_H */
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h
index 5195a3a627..405fce166d 100644
--- a/includes/rts/Flags.h
+++ b/includes/rts/Flags.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_FLAGS_H
-#define RTS_FLAGS_H
+#pragma once
#include <stdio.h>
#include <stdint.h>
@@ -282,5 +281,3 @@ extern char **prog_argv;
*/
extern int rts_argc; /* ditto */
extern char **rts_argv;
-
-#endif /* RTS_FLAGS_H */
diff --git a/includes/rts/GetTime.h b/includes/rts/GetTime.h
index e5dbd9e238..5b75b01bb8 100644
--- a/includes/rts/GetTime.h
+++ b/includes/rts/GetTime.h
@@ -11,9 +11,6 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_GETTIME_H
-#define RTS_GETTIME_H
+#pragma once
StgWord64 getMonotonicNSec (void);
-
-#endif /* RTS_GETTIME_H */
diff --git a/includes/rts/Globals.h b/includes/rts/Globals.h
index e3ff643556..63d26e7814 100644
--- a/includes/rts/Globals.h
+++ b/includes/rts/Globals.h
@@ -14,8 +14,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_GLOBALS_H
-#define RTS_GLOBALS_H
+#pragma once
#define mkStoreAccessorPrototype(name) \
StgStablePtr \
@@ -35,5 +34,3 @@ mkStoreAccessorPrototype(LibHSghcInitLinkerDone)
mkStoreAccessorPrototype(LibHSghcGlobalDynFlags)
mkStoreAccessorPrototype(LibHSghcStaticOptions)
mkStoreAccessorPrototype(LibHSghcStaticOptionsReady)
-
-#endif /* RTS_GLOBALS_H */
diff --git a/includes/rts/Hpc.h b/includes/rts/Hpc.h
index d70d1db829..58d4813ac1 100644
--- a/includes/rts/Hpc.h
+++ b/includes/rts/Hpc.h
@@ -11,8 +11,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_HPC_H
-#define RTS_HPC_H
+#pragma once
// Simple linked list of modules
typedef struct _HpcModuleInfo {
@@ -33,5 +32,3 @@ HpcModuleInfo * hs_hpc_rootModule (void);
void startupHpc(void);
void exitHpc(void);
-
-#endif /* RTS_HPC_H */
diff --git a/includes/rts/IOManager.h b/includes/rts/IOManager.h
index f9e2cd7958..5d79a64b00 100644
--- a/includes/rts/IOManager.h
+++ b/includes/rts/IOManager.h
@@ -11,8 +11,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_IOMANAGER_H
-#define RTS_IOMANAGER_H
+#pragma once
#if defined(mingw32_HOST_OS)
@@ -42,5 +41,3 @@ void ioManagerWakeup (void);
void ioManagerDie (void);
void ioManagerStart (void);
#endif
-
-#endif /* RTS_IOMANAGER_H */
diff --git a/includes/rts/Libdw.h b/includes/rts/Libdw.h
index 6a3b95e462..391847552e 100644
--- a/includes/rts/Libdw.h
+++ b/includes/rts/Libdw.h
@@ -6,10 +6,7 @@
*
* --------------------------------------------------------------------------*/
-#include "Rts.h"
-
-#ifndef RTS_LIBDW_H
-#define RTS_LIBDW_H
+#pragma once
// Chunk capacity
// This is rather arbitrary
@@ -92,5 +89,3 @@ Backtrace *libdwGetBacktrace(LibdwSession *session);
/* Lookup Location information for the given address.
* Returns 0 if successful, 1 if address could not be found. */
int libdwLookupLocation(LibdwSession *session, Location *loc, StgPtr pc);
-
-#endif /* RTS_LIBDW_H */
diff --git a/includes/rts/LibdwPool.h b/includes/rts/LibdwPool.h
index 3360192725..76ff41c8c7 100644
--- a/includes/rts/LibdwPool.h
+++ b/includes/rts/LibdwPool.h
@@ -6,8 +6,7 @@
*
* --------------------------------------------------------------------------*/
-#ifndef RTS_LIBDW_POOL_H
-#define RTS_LIBDW_POOL_H
+#pragma once
/* Claim a session from the pool */
LibdwSession *libdwPoolTake(void);
@@ -18,5 +17,3 @@ void libdwPoolRelease(LibdwSession *sess);
/* Free any sessions in the pool forcing a reload of any loaded debug
* information */
void libdwPoolClear(void);
-
-#endif /* RTS_LIBDW_POOL_H */
diff --git a/includes/rts/Linker.h b/includes/rts/Linker.h
index 34bf0df741..793195b3ab 100644
--- a/includes/rts/Linker.h
+++ b/includes/rts/Linker.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_LINKER_H
-#define RTS_LINKER_H
+#pragma once
#if defined(mingw32_HOST_OS)
typedef wchar_t pathchar;
@@ -86,5 +85,3 @@ pathchar* findSystemLibrary(pathchar* dll_name);
/* called by the initialization code for a module, not a user API */
StgStablePtr foreignExportStablePtr (StgPtr p);
-
-#endif /* RTS_LINKER_H */
diff --git a/includes/rts/Main.h b/includes/rts/Main.h
index 1c332fc95c..05924ad92b 100644
--- a/includes/rts/Main.h
+++ b/includes/rts/Main.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTSMAIN_H
-#define RTSMAIN_H
+#pragma once
/* -----------------------------------------------------------------------------
* The entry point for Haskell programs that use a Haskell main function
@@ -17,5 +16,3 @@ int hs_main (int argc, char *argv[], // program args
StgClosure *main_closure, // closure for Main.main
RtsConfig rts_config) // RTS configuration
GNUC3_ATTRIBUTE(__noreturn__);
-
-#endif /* RTSMAIN_H */
diff --git a/includes/rts/Messages.h b/includes/rts/Messages.h
index 85ffddaffd..2a6a84b821 100644
--- a/includes/rts/Messages.h
+++ b/includes/rts/Messages.h
@@ -14,8 +14,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_MESSAGES_H
-#define RTS_MESSAGES_H
+#pragma once
#include <stdarg.h>
@@ -102,5 +101,3 @@ extern RtsMsgFunction rtsFatalInternalErrorFn;
extern RtsMsgFunction rtsDebugMsgFn;
extern RtsMsgFunction rtsErrorMsgFn;
extern RtsMsgFunction rtsSysErrorMsgFn;
-
-#endif /* RTS_MESSAGES_H */
diff --git a/includes/rts/OSThreads.h b/includes/rts/OSThreads.h
index 2ebbd1e0f1..05e52d919a 100644
--- a/includes/rts/OSThreads.h
+++ b/includes/rts/OSThreads.h
@@ -12,8 +12,7 @@
*
* --------------------------------------------------------------------------*/
-#ifndef RTS_OSTHREADS_H
-#define RTS_OSTHREADS_H
+#pragma once
#if defined(HAVE_PTHREAD_H) && !defined(mingw32_HOST_OS)
@@ -257,5 +256,3 @@ typedef StgWord64 KernelThreadId;
KernelThreadId kernelThreadId (void);
#endif /* CMINUSMINUS */
-
-#endif /* RTS_OSTHREADS_H */
diff --git a/includes/rts/Parallel.h b/includes/rts/Parallel.h
index 2c84327729..de1c6e1fae 100644
--- a/includes/rts/Parallel.h
+++ b/includes/rts/Parallel.h
@@ -11,9 +11,6 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_PARALLEL_H
-#define RTS_PARALLEL_H
+#pragma once
StgInt newSpark (StgRegTable *reg, StgClosure *p);
-
-#endif /* RTS_PARALLEL_H */
diff --git a/includes/rts/PrimFloat.h b/includes/rts/PrimFloat.h
index 248ea6246f..835a18aac4 100644
--- a/includes/rts/PrimFloat.h
+++ b/includes/rts/PrimFloat.h
@@ -9,12 +9,9 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_PRIMFLOAT_H
-#define RTS_PRIMFLOAT_H
+#pragma once
StgDouble __int_encodeDouble (I_ j, I_ e);
StgFloat __int_encodeFloat (I_ j, I_ e);
StgDouble __word_encodeDouble (W_ j, I_ e);
StgFloat __word_encodeFloat (W_ j, I_ e);
-
-#endif /* RTS_PRIMFLOAT_H */
diff --git a/includes/rts/Signals.h b/includes/rts/Signals.h
index 22cbe4ad77..d321b0d0c4 100644
--- a/includes/rts/Signals.h
+++ b/includes/rts/Signals.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_SIGNALS_H
-#define RTS_SIGNALS_H
+#pragma once
/* NB. #included in Haskell code, no prototypes in here. */
@@ -22,5 +21,3 @@
#define STG_SIG_ERR (-3)
#define STG_SIG_HAN (-4)
#define STG_SIG_RST (-5)
-
-#endif /* RTS_SIGNALS_H */
diff --git a/includes/rts/SpinLock.h b/includes/rts/SpinLock.h
index dccd86705c..6530a3a2f0 100644
--- a/includes/rts/SpinLock.h
+++ b/includes/rts/SpinLock.h
@@ -19,9 +19,8 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_SPINLOCK_H
-#define RTS_SPINLOCK_H
-
+#pragma once
+
#if defined(THREADED_RTS)
#if defined(PROF_SPIN)
@@ -112,6 +111,3 @@ INLINE_HEADER void initSpinLock(void * p STG_UNUSED)
{ /* nothing */ }
#endif /* THREADED_RTS */
-
-#endif /* RTS_SPINLOCK_H */
-
diff --git a/includes/rts/Stable.h b/includes/rts/Stable.h
index f75b9ab806..75fcf4f7eb 100644
--- a/includes/rts/Stable.h
+++ b/includes/rts/Stable.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_STABLE_H
-#define RTS_STABLE_H
+#pragma once
EXTERN_INLINE StgPtr deRefStablePtr (StgStablePtr stable_ptr);
StgStablePtr getStablePtr (StgPtr p);
@@ -39,5 +38,3 @@ StgPtr deRefStablePtr(StgStablePtr sp)
{
return stable_ptr_table[(StgWord)sp].addr;
}
-
-#endif /* RTS_STABLE_H */
diff --git a/includes/rts/StaticPtrTable.h b/includes/rts/StaticPtrTable.h
index e536f4b496..97a1720823 100644
--- a/includes/rts/StaticPtrTable.h
+++ b/includes/rts/StaticPtrTable.h
@@ -11,8 +11,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_STATICPTRTABLE_H
-#define RTS_STATICPTRTABLE_H
+#pragma once
/** Inserts an entry in the Static Pointer Table.
*
@@ -43,5 +42,3 @@ void hs_spt_insert_stableptr(StgWord64 key[2], StgStablePtr *entry);
*
* */
void hs_spt_remove (StgWord64 key[2]);
-
-#endif /* RTS_STATICPTRTABLE_H */
diff --git a/includes/rts/TTY.h b/includes/rts/TTY.h
index f0b4225fbf..3555818c4a 100644
--- a/includes/rts/TTY.h
+++ b/includes/rts/TTY.h
@@ -11,10 +11,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_TTY_H
-#define RTS_TTY_H
+#pragma once
void* __hscore_get_saved_termios(int fd);
void __hscore_set_saved_termios(int fd, void* ts);
-
-#endif /* RTS_TTY_H */
diff --git a/includes/rts/Threads.h b/includes/rts/Threads.h
index f45d351c2b..17a64c1ba0 100644
--- a/includes/rts/Threads.h
+++ b/includes/rts/Threads.h
@@ -12,8 +12,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_THREADS_H
-#define RTS_THREADS_H
+#pragma once
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -75,5 +74,3 @@ extern Capability MainCapability;
// current value at the moment).
//
extern void setNumCapabilities (uint32_t new_);
-
-#endif /* RTS_THREADS_H */
diff --git a/includes/rts/Ticky.h b/includes/rts/Ticky.h
index ff4d44a0d0..de4e518430 100644
--- a/includes/rts/Ticky.h
+++ b/includes/rts/Ticky.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_TICKY_H
-#define RTS_TICKY_H
+#pragma once
/* -----------------------------------------------------------------------------
The StgEntCounter type - needed regardless of TICKY_TICKY
@@ -31,5 +30,3 @@ typedef struct _StgEntCounter {
StgInt allocs; /* number of allocations by this fun */
struct _StgEntCounter *link;/* link to chain them all together */
} StgEntCounter;
-
-#endif /* RTS_TICKY_H */
diff --git a/includes/rts/Time.h b/includes/rts/Time.h
index a1debedea0..5fa166e125 100644
--- a/includes/rts/Time.h
+++ b/includes/rts/Time.h
@@ -9,8 +9,7 @@
*
* --------------------------------------------------------------------------*/
-#ifndef RTSTIME_H
-#define RTSTIME_H
+#pragma once
// For most time values in the RTS we use a fixed resolution of nanoseconds,
// normalising the time we get from platform-dependent APIs to this
@@ -39,5 +38,3 @@ INLINE_HEADER Time fsecondsToTime (double t)
{
return (Time)(t * TIME_RESOLUTION);
}
-
-#endif // RTSTIME_H
diff --git a/includes/rts/Timer.h b/includes/rts/Timer.h
index ca039537d3..f0a63d8d39 100644
--- a/includes/rts/Timer.h
+++ b/includes/rts/Timer.h
@@ -11,11 +11,8 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_TIMER_H
-#define RTS_TIMER_H
+#pragma once
void startTimer (void);
void stopTimer (void);
int rtsTimerSignal (void);
-
-#endif /* RTS_TIMER_H */
diff --git a/includes/rts/Types.h b/includes/rts/Types.h
index 4b0e680ae5..242b831819 100644
--- a/includes/rts/Types.h
+++ b/includes/rts/Types.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_TYPES_H
-#define RTS_TYPES_H
+#pragma once
#include <stddef.h>
#include <stdbool.h>
@@ -30,5 +29,3 @@ typedef unsigned int nat __attribute__((deprecated)); /* uint32_t */
typedef struct StgClosure_ StgClosure;
typedef struct StgInfoTable_ StgInfoTable;
typedef struct StgTSO_ StgTSO;
-
-#endif /* RTS_TYPES_H */
diff --git a/includes/rts/Utils.h b/includes/rts/Utils.h
index a4a57ab332..4ab025b887 100644
--- a/includes/rts/Utils.h
+++ b/includes/rts/Utils.h
@@ -10,10 +10,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_UTILS_H
-#define RTS_UTILS_H
+#pragma once
/* Alternate to raise(3) for threaded rts, for BSD-based OSes */
int genericRaise(int sig);
-
-#endif /* RTS_UTILS_H */
diff --git a/includes/rts/prof/CCS.h b/includes/rts/prof/CCS.h
index 1ed53c1d7c..4805063a0f 100644
--- a/includes/rts/prof/CCS.h
+++ b/includes/rts/prof/CCS.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_PROF_CCS_H
-#define RTS_PROF_CCS_H
+#pragma once
/* -----------------------------------------------------------------------------
* Data Structures
@@ -253,5 +252,3 @@ extern CostCentreStack * RTS_VAR(CCS_LIST); // registered CCS list
#define ENTER_CCS_THUNK(cap,p) doNothing()
#endif /* PROFILING */
-
-#endif /* RTS_PROF_CCS_H */
diff --git a/includes/rts/prof/LDV.h b/includes/rts/prof/LDV.h
index 7d6f9ff409..fdbab4d901 100644
--- a/includes/rts/prof/LDV.h
+++ b/includes/rts/prof/LDV.h
@@ -11,8 +11,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_PROF_LDV_H
-#define RTS_PROF_LDV_H
+#pragma once
#ifdef PROFILING
@@ -43,5 +42,3 @@
#define LDV_RECORD_CREATE(c) /* nothing */
#endif /* PROFILING */
-
-#endif /* STGLDVPROF_H */
diff --git a/includes/rts/storage/Block.h b/includes/rts/storage/Block.h
index 7d6f102ab8..3c6f2b1fba 100644
--- a/includes/rts/storage/Block.h
+++ b/includes/rts/storage/Block.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_STORAGE_BLOCK_H
-#define RTS_STORAGE_BLOCK_H
+#pragma once
#include "ghcconfig.h"
@@ -351,4 +350,3 @@ round_up_to_mblocks(StgWord words)
}
#endif /* !CMINUSMINUS */
-#endif /* RTS_STORAGE_BLOCK_H */
diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h
index c8c270fdfe..af77df37b5 100644
--- a/includes/rts/storage/ClosureMacros.h
+++ b/includes/rts/storage/ClosureMacros.h
@@ -6,8 +6,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_STORAGE_CLOSUREMACROS_H
-#define RTS_STORAGE_CLOSUREMACROS_H
+#pragma once
/* -----------------------------------------------------------------------------
Info tables are slammed up against the entry code, and the label
@@ -596,5 +595,3 @@ EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset)
for (i = offset; i < size; i++)
((StgWord *)p)[i] = 0;
}
-
-#endif /* RTS_STORAGE_CLOSUREMACROS_H */
diff --git a/includes/rts/storage/ClosureTypes.h b/includes/rts/storage/ClosureTypes.h
index 234e00b174..68cc919257 100644
--- a/includes/rts/storage/ClosureTypes.h
+++ b/includes/rts/storage/ClosureTypes.h
@@ -7,8 +7,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_STORAGE_CLOSURETYPES_H
-#define RTS_STORAGE_CLOSURETYPES_H
+#pragma once
/*
* WARNING WARNING WARNING
@@ -83,5 +82,3 @@
#define SMALL_MUT_ARR_PTRS_FROZEN 62
#define COMPACT_NFDATA 63
#define N_CLOSURE_TYPES 64
-
-#endif /* RTS_STORAGE_CLOSURETYPES_H */
diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h
index 2c62552b2f..f5baead002 100644
--- a/includes/rts/storage/Closures.h
+++ b/includes/rts/storage/Closures.h
@@ -6,8 +6,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_STORAGE_CLOSURES_H
-#define RTS_STORAGE_CLOSURES_H
+#pragma once
/*
* The Layout of a closure header depends on which kind of system we're
@@ -475,6 +474,3 @@ typedef struct StgCompactNFData_ {
// Used temporarily to store the result of compaction. Doesn't need to be
// a GC root.
} StgCompactNFData;
-
-
-#endif /* RTS_STORAGE_CLOSURES_H */
diff --git a/includes/rts/storage/FunTypes.h b/includes/rts/storage/FunTypes.h
index 8c565888c1..27858fb82b 100644
--- a/includes/rts/storage/FunTypes.h
+++ b/includes/rts/storage/FunTypes.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_STORAGE_FUNTYPES_H
-#define RTS_STORAGE_FUNTYPES_H
+#pragma once
/* generic - function comes with a small bitmap */
#define ARG_GEN 0
@@ -53,5 +52,3 @@
#define ARG_PPPPPP 26
#define ARG_PPPPPPP 27
#define ARG_PPPPPPPP 28
-
-#endif /* RTS_STORAGE_FUNTYPES_H */
diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h
index ddc4238592..387bd260d3 100644
--- a/includes/rts/storage/GC.h
+++ b/includes/rts/storage/GC.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_STORAGE_GC_H
-#define RTS_STORAGE_GC_H
+#pragma once
#include <stddef.h>
#include "rts/OSThreads.h"
@@ -241,5 +240,3 @@ INLINE_HEADER void initBdescr(bdescr *bd, generation *gen, generation *dest)
bd->gen_no = gen->no;
bd->dest_no = dest->no;
}
-
-#endif /* RTS_STORAGE_GC_H */
diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h
index 307aac371c..e732a30daf 100644
--- a/includes/rts/storage/InfoTables.h
+++ b/includes/rts/storage/InfoTables.h
@@ -6,8 +6,7 @@
*
* -------------------------------------------------------------------------- */
-#ifndef RTS_STORAGE_INFOTABLES_H
-#define RTS_STORAGE_INFOTABLES_H
+#pragma once
/* ----------------------------------------------------------------------------
Relative pointers
@@ -394,5 +393,3 @@ typedef struct StgConInfoTable_ {
#else
#define GET_PROF_DESC(info) ((info)->prof.closure_desc)
#endif
-
-#endif /* RTS_STORAGE_INFOTABLES_H */
diff --git a/includes/rts/storage/MBlock.h b/includes/rts/storage/MBlock.h
index a8251c8c0b..9fbe92ec7d 100644
--- a/includes/rts/storage/MBlock.h
+++ b/includes/rts/storage/MBlock.h
@@ -9,8 +9,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_STORAGE_MBLOCK_H
-#define RTS_STORAGE_MBLOCK_H
+#pragma once
extern W_ peak_mblocks_allocated;
extern W_ mblocks_allocated;
@@ -31,5 +30,3 @@ extern void *getNextMBlock(void **state, void *mblock);
// needed for HEAP_ALLOCED below
extern SpinLock gc_alloc_block_sync;
#endif
-
-#endif /* RTS_STORAGE_MBLOCK_H */
diff --git a/includes/rts/storage/TSO.h b/includes/rts/storage/TSO.h
index fd32919e9d..e50e336a32 100644
--- a/includes/rts/storage/TSO.h
+++ b/includes/rts/storage/TSO.h
@@ -6,8 +6,7 @@
*
* ---------------------------------------------------------------------------*/
-#ifndef RTS_STORAGE_TSO_H
-#define RTS_STORAGE_TSO_H
+#pragma once
/*
* PROFILING info in a TSO
@@ -260,5 +259,3 @@ void dirty_STACK (Capability *cap, StgStack *stack);
/* this is the NIL ptr for a TSO queue (e.g. runnable queue) */
#define END_TSO_QUEUE ((StgTSO *)(void*)&stg_END_TSO_QUEUE_closure)
-
-#endif /* RTS_STORAGE_TSO_H */
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 */