From d7c6c4717cdf1b7bd8550e37da66c52275c802f0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 10 Jul 2019 11:54:47 -0400 Subject: Expunge #ifdef and #ifndef from the codebase These are unexploded minds as far as the linter is concerned. I don't want to hit in my MRs by mistake! I did this with `sed`, and then rolled back some changes in the docs, config.guess, and the linter itself. --- compiler/main/CodeOutput.hs | 4 +-- compiler/main/DynFlags.hs | 2 +- compiler/utils/Util.hs | 2 +- docs/coding-style.html | 10 +++---- docs/storage-mgt/rp.tex | 2 +- libraries/base/System/Environment/Blank.hsc | 6 ++-- libraries/base/tests/IO/T12010/T12010.hsc | 6 ++-- libraries/libiserv/src/GHCi/Utils.hsc | 4 +-- rts/Capability.c | 6 ++-- rts/Capability.h | 2 +- rts/Hash.c | 2 +- rts/LinkerInternals.h | 2 +- rts/RtsMessages.c | 2 +- rts/RtsSymbols.c | 2 +- rts/StgCRunAsm.S | 2 +- rts/Ticky.c | 2 +- rts/Trace.c | 2 +- rts/linker/ELFRelocs/AArch64.def | 2 +- rts/linker/ELFRelocs/ARM.def | 2 +- rts/linker/ELFRelocs/i386.def | 2 +- rts/linker/ELFRelocs/x86_64.def | 2 +- rts/linker/Elf.c | 4 +-- rts/linker/ElfTypes.h | 2 +- rts/linker/elf_compat.h | 2 +- rts/linker/elf_util.h | 2 +- rts/linker/util.h | 2 +- rts/package.conf.in | 2 +- rts/posix/OSMem.c | 6 ++-- rts/posix/Select.c | 4 +-- rts/win32/ConsoleHandler.c | 6 ++-- rts/xxhash.c | 32 +++++++++++----------- rts/xxhash.h | 22 +++++++-------- testsuite/tests/codeGen/should_run/T7600.hs | 2 +- testsuite/tests/codeGen/should_run/cgrun044.hs | 2 +- testsuite/tests/concurrent/should_run/conc036.hs | 2 +- testsuite/tests/concurrent/should_run/conc037.hs | 2 +- testsuite/tests/concurrent/should_run/conc038.hs | 2 +- testsuite/tests/concurrent/should_run/conc059.hs | 2 +- .../concurrent/should_run/foreignInterruptible.hs | 2 +- testsuite/tests/driver/T11763.hs | 2 +- testsuite/tests/driver/T2464.hs | 2 +- testsuite/tests/ffi/should_compile/T11983.h | 2 +- testsuite/tests/ffi/should_run/capi_ctype_001.h | 2 +- testsuite/tests/ffi/should_run/capi_ctype_002_A.h | 2 +- testsuite/tests/ffi/should_run/capi_ctype_002_B.h | 2 +- testsuite/tests/ffi/should_run/fptr01.h | 2 +- testsuite/tests/ffi/should_run/fptrfail01.h | 2 +- testsuite/tests/hsc2hs/T10272.h | 2 +- .../tests/indexed-types/should_compile/T12538.hs | 2 +- testsuite/tests/rename/should_fail/T9032.hs | 2 +- testsuite/tests/rts/T12031/foo.h | 2 +- testsuite/tests/rts/spalign.c | 4 +-- testsuite/tests/rts/testheapalloced.c | 6 ++-- testsuite/tests/rts/testwsdeque.c | 6 ++-- .../tests/simplCore/T9646/cbits/primitive-memops.h | 2 +- testsuite/tests/simplCore/should_compile/T8832.hs | 4 +-- testsuite/tests/typecheck/should_run/T1735.hs | 2 +- .../tests/typecheck/should_run/T1735_Help/Main.hs | 2 +- utils/iserv/src/Main.hs | 2 +- 59 files changed, 108 insertions(+), 108 deletions(-) diff --git a/compiler/main/CodeOutput.hs b/compiler/main/CodeOutput.hs index 050e6f5c14..6f80df9676 100644 --- a/compiler/main/CodeOutput.hs +++ b/compiler/main/CodeOutput.hs @@ -252,8 +252,8 @@ outputForeignStubs dflags mod location stubs then Just stub_c else Nothing ) where - cplusplus_hdr = "#ifdef __cplusplus\nextern \"C\" {\n#endif\n" - cplusplus_ftr = "#ifdef __cplusplus\n}\n#endif\n" + cplusplus_hdr = "#if defined(__cplusplus)\nextern \"C\" {\n#endif\n" + cplusplus_ftr = "#if defined(__cplusplus)\n}\n#endif\n" -- Don't use doOutput for dumping the f. export stubs diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 7009771aa4..2315be3519 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3020,7 +3020,7 @@ dynamic_flags_deps = [ , make_ord_flag defGhcFlag "rdynamic" $ noArg $ #if defined(linux_HOST_OS) addOptl "-rdynamic" -#elif defined (mingw32_HOST_OS) +#elif defined(mingw32_HOST_OS) addOptl "-Wl,--export-all-symbols" #else -- ignored for compat w/ gcc: diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs index aa4afa5451..dba5a4495f 100644 --- a/compiler/utils/Util.hs +++ b/compiler/utils/Util.hs @@ -576,7 +576,7 @@ only _ = panic "Util: only" isIn, isn'tIn :: Eq a => String -> a -> [a] -> Bool -# ifndef DEBUG +# if !defined(DEBUG) isIn _msg x ys = x `elem` ys isn'tIn _msg x ys = x `notElem` ys diff --git a/docs/coding-style.html b/docs/coding-style.html index 6be9263d97..dbf0f8729a 100644 --- a/docs/coding-style.html +++ b/docs/coding-style.html @@ -88,7 +88,7 @@ together implement a subsystem which is described by a single external header file).

  • We use the following GCC extensions, but surround them with -#ifdef __GNUC__: +#if defined(__GNUC__):