From ac44d2ea6e21212cc0e8c9f1c4e0e3a9b3666420 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Tue, 2 Aug 2016 08:07:09 -0700 Subject: [PATCH] use #pragma once Summary: #pragma once is widely supported and is a lot harder to get wrong than #ifdef include guards. Reviewed By: lucasr Differential Revision: D3648895 fbshipit-source-id: faf42cda82764adaf41cf3f3f9109d48aea203fe --- CSSLayout/CSSLayout-internal.h | 5 +---- CSSLayout/CSSLayout.h | 5 +---- CSSLayout/CSSMacros.h | 5 +---- CSSLayout/CSSNodeList.h | 5 +---- benchmarks/CSSBenchmark.h | 5 +---- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/CSSLayout/CSSLayout-internal.h b/CSSLayout/CSSLayout-internal.h index b55b597c..7ba85c32 100644 --- a/CSSLayout/CSSLayout-internal.h +++ b/CSSLayout/CSSLayout-internal.h @@ -7,8 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#ifndef __CSS_LAYOUT_INTERNAL_H -#define __CSS_LAYOUT_INTERNAL_H +#pragma once #include "CSSLayout.h" #include "CSSNodeList.h" @@ -98,5 +97,3 @@ typedef struct CSSNode { } CSSNode; CSS_EXTERN_C_END - -#endif diff --git a/CSSLayout/CSSLayout.h b/CSSLayout/CSSLayout.h index 24a3d9c3..9d5af32a 100644 --- a/CSSLayout/CSSLayout.h +++ b/CSSLayout/CSSLayout.h @@ -7,8 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#ifndef __CSS_LAYOUT_H -#define __CSS_LAYOUT_H +#pragma once #include #include @@ -214,5 +213,3 @@ CSS_NODE_LAYOUT_PROPERTY(float, Height); CSS_NODE_LAYOUT_PROPERTY(CSSDirection, Direction); CSS_EXTERN_C_END - -#endif diff --git a/CSSLayout/CSSMacros.h b/CSSLayout/CSSMacros.h index a2fc8e37..1cf88202 100644 --- a/CSSLayout/CSSMacros.h +++ b/CSSLayout/CSSMacros.h @@ -7,8 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#ifndef __CSS_MACROS_H -#define __CSS_MACROS_H +#pragma once #ifdef __cplusplus # define CSS_EXTERN_C_BEGIN extern "C" { @@ -17,5 +16,3 @@ # define CSS_EXTERN_C_BEGIN # define CSS_EXTERN_C_END #endif - -#endif diff --git a/CSSLayout/CSSNodeList.h b/CSSLayout/CSSNodeList.h index 8883c3ec..d6904efb 100644 --- a/CSSLayout/CSSNodeList.h +++ b/CSSLayout/CSSNodeList.h @@ -7,8 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#ifndef __CSS_NODE_LIST_H -#define __CSS_NODE_LIST_H +#pragma once #include #include @@ -31,5 +30,3 @@ CSSNodeRef CSSNodeListDelete(CSSNodeListRef list, CSSNodeRef node); CSSNodeRef CSSNodeListGet(CSSNodeListRef list, uint32_t index); CSS_EXTERN_C_END - -#endif diff --git a/benchmarks/CSSBenchmark.h b/benchmarks/CSSBenchmark.h index 4006e796..7fda958a 100644 --- a/benchmarks/CSSBenchmark.h +++ b/benchmarks/CSSBenchmark.h @@ -7,8 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#ifndef __CSS_BENCHMARK_H -#define __CSS_BENCHMARK_H +#pragma once #include #include @@ -40,5 +39,3 @@ void __printBenchmarkResult(char *name, clock_t start, clock_t end) { printf("%lf ms", mean); printf("\n"); } - -#endif