diff options
author | Elliott Hughes <enh@google.com> | 2020-03-23 13:29:04 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2020-03-23 13:29:04 -0700 |
commit | 715f20250aaf565de693c3a77f40e54031be11e5 (patch) | |
tree | 729e104ff6831343caf7e1afd8014232b35b8c26 /sources | |
parent | 5aec38c42f1e6da17437c72066e4a59beb5a265f (diff) | |
download | ndk-715f20250aaf565de693c3a77f40e54031be11e5.tar.gz |
Switch the NDK source/ headers to #pragma once.
Because we look silly when our demo of IntelliSense in Visual Studio is
only offering completions that are header file include guard spam.
Bug: https://youtu.be/JXQBdMNDL7k?t=215
Test: treehugger
Change-Id: I608e1e000dec3f4b4919263dfb5688f42c02b1b1
Diffstat (limited to 'sources')
-rw-r--r-- | sources/android/cpufeatures/cpu-features.h | 6 | ||||
-rw-r--r-- | sources/android/libthread_db/thread_db.h | 5 | ||||
-rw-r--r-- | sources/android/ndk_helper/GLContext.h | 8 | ||||
-rw-r--r-- | sources/android/ndk_helper/NDKHelper.h | 4 | ||||
-rw-r--r-- | sources/android/ndk_helper/gestureDetector.h | 7 | ||||
-rw-r--r-- | sources/android/ndk_helper/gl3stub.h | 7 | ||||
-rw-r--r-- | sources/android/ndk_helper/interpolator.h | 4 | ||||
-rw-r--r-- | sources/android/ndk_helper/perfMonitor.h | 4 | ||||
-rw-r--r-- | sources/android/ndk_helper/shader.h | 4 | ||||
-rw-r--r-- | sources/android/ndk_helper/tapCamera.h | 1 | ||||
-rw-r--r-- | sources/android/ndk_helper/vecmath.h | 4 | ||||
-rw-r--r-- | sources/android/support/include/inttypes.h | 5 | ||||
-rw-r--r-- | sources/android/support/include/locale.h | 5 | ||||
-rw-r--r-- | sources/android/support/include/math.h | 5 | ||||
-rw-r--r-- | sources/android/support/include/stdlib.h | 5 | ||||
-rw-r--r-- | sources/android/support/include/uchar.h | 5 | ||||
-rw-r--r-- | sources/android/support/include/wchar.h | 5 | ||||
-rw-r--r-- | sources/android/support/include/wctype.h | 5 | ||||
-rw-r--r-- | sources/android/support/src/UniquePtr.h | 6 |
19 files changed, 22 insertions, 73 deletions
diff --git a/sources/android/cpufeatures/cpu-features.h b/sources/android/cpufeatures/cpu-features.h index 1e9724197..d38990886 100644 --- a/sources/android/cpufeatures/cpu-features.h +++ b/sources/android/cpufeatures/cpu-features.h @@ -25,8 +25,8 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef CPU_FEATURES_H -#define CPU_FEATURES_H + +#pragma once #include <sys/cdefs.h> #include <stdint.h> @@ -319,5 +319,3 @@ extern int android_setCpuArm(int cpu_count, #endif __END_DECLS - -#endif /* CPU_FEATURES_H */ diff --git a/sources/android/libthread_db/thread_db.h b/sources/android/libthread_db/thread_db.h index 9ed419901..be57393e9 100644 --- a/sources/android/libthread_db/thread_db.h +++ b/sources/android/libthread_db/thread_db.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _LIBTHREAD_DB__THREAD_DB_H -#define _LIBTHREAD_DB__THREAD_DB_H +#pragma once #include <pthread.h> #include <signal.h> @@ -173,5 +172,3 @@ extern td_err_e td_thr_tls_get_addr(const td_thrhandle_t*, psaddr_t, size_t, psa #ifdef __cplusplus } #endif - -#endif diff --git a/sources/android/ndk_helper/GLContext.h b/sources/android/ndk_helper/GLContext.h index cc0db463e..8862aa445 100644 --- a/sources/android/ndk_helper/GLContext.h +++ b/sources/android/ndk_helper/GLContext.h @@ -14,11 +14,7 @@ * limitations under the License. */ -//-------------------------------------------------------------------------------- -// GLContext.h -//-------------------------------------------------------------------------------- -#ifndef GLCONTEXT_H_ -#define GLCONTEXT_H_ +#pragma once #include <EGL/egl.h> #include <GLES2/gl2.h> @@ -121,5 +117,3 @@ public: }; } //namespace ndkHelper - -#endif /* GLCONTEXT_H_ */ diff --git a/sources/android/ndk_helper/NDKHelper.h b/sources/android/ndk_helper/NDKHelper.h index de2a10e63..c170b5bf9 100644 --- a/sources/android/ndk_helper/NDKHelper.h +++ b/sources/android/ndk_helper/NDKHelper.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _NDKSUPPORT_H -#define _NDKSUPPORT_H +#pragma once /****************************************************************** * NDK support helpers @@ -36,4 +35,3 @@ #include "gestureDetector.h" //Tap/Doubletap/Pinch detector #include "perfMonitor.h" //FPS counter #include "interpolator.h" //Interpolator -#endif diff --git a/sources/android/ndk_helper/gestureDetector.h b/sources/android/ndk_helper/gestureDetector.h index 6ae5d80ef..6c8683bf7 100644 --- a/sources/android/ndk_helper/gestureDetector.h +++ b/sources/android/ndk_helper/gestureDetector.h @@ -14,11 +14,7 @@ * limitations under the License. */ -//-------------------------------------------------------------------------------- -// gestureDetector.h -//-------------------------------------------------------------------------------- -#ifndef GESTUREDETECTOR_H_ -#define GESTUREDETECTOR_H_ +#pragma once #include <vector> @@ -163,4 +159,3 @@ public: }; } //namespace ndkHelper -#endif /* GESTUREDETECTOR_H_ */ diff --git a/sources/android/ndk_helper/gl3stub.h b/sources/android/ndk_helper/gl3stub.h index c8960dfd6..2b8df9c15 100644 --- a/sources/android/ndk_helper/gl3stub.h +++ b/sources/android/ndk_helper/gl3stub.h @@ -1,6 +1,3 @@ -#ifndef __gl3_h_ -#define __gl3_h_ - /* * stub gl3.h for dynamic loading, based on: * gl3.h last updated on $Date: 2013-02-12 14:37:24 -0800 (Tue, 12 Feb 2013) $ @@ -13,6 +10,8 @@ * - Added gl3stubInit() declaration */ +#pragma once + #include <GLES2/gl2.h> #include <android/api-level.h> @@ -500,5 +499,3 @@ extern GL_APICALL void (* GL_APIENTRY glGetInternalformativ) (GLenum target, GLe #ifdef __cplusplus } #endif - -#endif diff --git a/sources/android/ndk_helper/interpolator.h b/sources/android/ndk_helper/interpolator.h index 1226e334b..61b8d8f0a 100644 --- a/sources/android/ndk_helper/interpolator.h +++ b/sources/android/ndk_helper/interpolator.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef INTERPOLATOR_H_ -#define INTERPOLATOR_H_ +#pragma once #include <jni.h> #include <errno.h> @@ -86,4 +85,3 @@ public: }; } //namespace ndkHelper -#endif /* INTERPOLATOR_H_ */ diff --git a/sources/android/ndk_helper/perfMonitor.h b/sources/android/ndk_helper/perfMonitor.h index f418c436b..b886d6df6 100644 --- a/sources/android/ndk_helper/perfMonitor.h +++ b/sources/android/ndk_helper/perfMonitor.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef PERFMONITOR_H_ -#define PERFMONITOR_H_ +#pragma once #include <jni.h> #include <errno.h> @@ -58,4 +57,3 @@ public: }; } //namespace ndkHelper -#endif /* PERFMONITOR_H_ */ diff --git a/sources/android/ndk_helper/shader.h b/sources/android/ndk_helper/shader.h index d362a5344..8a21a1177 100644 --- a/sources/android/ndk_helper/shader.h +++ b/sources/android/ndk_helper/shader.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef SHADER_H_ -#define SHADER_H_ +#pragma once #include <jni.h> @@ -121,4 +120,3 @@ bool ValidateProgram( const GLuint prog ); } //namespace shader } //namespace ndkHelper -#endif /* SHADER_H_ */ diff --git a/sources/android/ndk_helper/tapCamera.h b/sources/android/ndk_helper/tapCamera.h index 7d124e8e2..92f282e4e 100644 --- a/sources/android/ndk_helper/tapCamera.h +++ b/sources/android/ndk_helper/tapCamera.h @@ -15,6 +15,7 @@ */ #pragma once + #include <vector> #include <string> #include <GLES2/gl2.h> diff --git a/sources/android/ndk_helper/vecmath.h b/sources/android/ndk_helper/vecmath.h index 0692e3d01..a81e4f8a1 100644 --- a/sources/android/ndk_helper/vecmath.h +++ b/sources/android/ndk_helper/vecmath.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef VECMATH_H_ -#define VECMATH_H_ +#pragma once #include <math.h> #include "JNIHelper.h" @@ -1113,4 +1112,3 @@ public: }; } //namespace ndk_helper -#endif /* VECMATH_H_ */ diff --git a/sources/android/support/include/inttypes.h b/sources/android/support/include/inttypes.h index 00887bca5..834ab9170 100644 --- a/sources/android/support/include/inttypes.h +++ b/sources/android/support/include/inttypes.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef NDK_ANDROID_SUPPORT_INTTYPES_H -#define NDK_ANDROID_SUPPORT_INTTYPES_H +#pragma once #include_next <inttypes.h> @@ -44,5 +43,3 @@ uintmax_t wcstoumax(const wchar_t* __restrict, wchar_t** __restrict, int); #endif __END_DECLS - -#endif diff --git a/sources/android/support/include/locale.h b/sources/android/support/include/locale.h index 72f847b38..9443f211b 100644 --- a/sources/android/support/include/locale.h +++ b/sources/android/support/include/locale.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef NDK_ANDROID_SUPPORT_LOCALE_H -#define NDK_ANDROID_SUPPORT_LOCALE_H +#pragma once #include_next <locale.h> @@ -42,5 +41,3 @@ locale_t uselocale(locale_t); #endif __END_DECLS - -#endif diff --git a/sources/android/support/include/math.h b/sources/android/support/include/math.h index 11d50cc95..8c29c6b47 100644 --- a/sources/android/support/include/math.h +++ b/sources/android/support/include/math.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef NDK_ANDROID_SUPPORT_MATH_H -#define NDK_ANDROID_SUPPORT_MATH_H +#pragma once #include_next <math.h> @@ -80,5 +79,3 @@ long long int llrintl(long double); #endif __END_DECLS - -#endif diff --git a/sources/android/support/include/stdlib.h b/sources/android/support/include/stdlib.h index 93e384d90..e52e8ce58 100644 --- a/sources/android/support/include/stdlib.h +++ b/sources/android/support/include/stdlib.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef NDK_ANDROID_SUPPORT_STDLIB_H -#define NDK_ANDROID_SUPPORT_STDLIB_H +#pragma once #include_next <stdlib.h> @@ -47,5 +46,3 @@ void quick_exit(int) __noreturn; #endif __END_DECLS - -#endif diff --git a/sources/android/support/include/uchar.h b/sources/android/support/include/uchar.h index 42942c415..88e508630 100644 --- a/sources/android/support/include/uchar.h +++ b/sources/android/support/include/uchar.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef NDK_ANDROID_SUPPORT_UCHAR_H -#define NDK_ANDROID_SUPPORT_UCHAR_H +#pragma once #include_next <uchar.h> @@ -41,5 +40,3 @@ size_t mbrtoc32(char32_t* __restrict, const char* __restrict, size_t, mbstate_t* #endif __END_DECLS - -#endif diff --git a/sources/android/support/include/wchar.h b/sources/android/support/include/wchar.h index 9152cfee9..edf5bd54d 100644 --- a/sources/android/support/include/wchar.h +++ b/sources/android/support/include/wchar.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef NDK_ANDROID_SUPPORT_WCHAR_H -#define NDK_ANDROID_SUPPORT_WCHAR_H +#pragma once #include_next <wchar.h> @@ -45,5 +44,3 @@ unsigned long long wcstoull(const wchar_t*, wchar_t**, int); #endif __END_DECLS - -#endif diff --git a/sources/android/support/include/wctype.h b/sources/android/support/include/wctype.h index 31d015d12..e66c37219 100644 --- a/sources/android/support/include/wctype.h +++ b/sources/android/support/include/wctype.h @@ -26,8 +26,7 @@ * SUCH DAMAGE. */ -#ifndef NDK_ANDROID_SUPPORT_WCTYPE_H -#define NDK_ANDROID_SUPPORT_WCTYPE_H +#pragma once #include_next <wctype.h> @@ -39,5 +38,3 @@ static __inline int iswblank(wint_t ch) { return isblank(ch); } #endif __END_DECLS - -#endif diff --git a/sources/android/support/src/UniquePtr.h b/sources/android/support/src/UniquePtr.h index 7479bcf65..06f14aa1d 100644 --- a/sources/android/support/src/UniquePtr.h +++ b/sources/android/support/src/UniquePtr.h @@ -25,8 +25,8 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef ANDROID_SUPPORT_UNIQUE_PTR_H -#define ANDROID_SUPPORT_UNIQUE_PTR_H + +#pragma once namespace { @@ -135,5 +135,3 @@ class UniquePtr<T[], D> { }; } // anonymous namespace - -#endif /* ANDROID_SUPPORT_UNIQUE_PTR_H */ |