summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-05-25 21:14:18 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-05-25 21:35:37 +0200
commite2bcea90fce8a1e05e517c615d21d845e955f53d (patch)
tree208da7ad0db235a13b5ae6d360279a624e46fb95 /scripts
parent6368403f433cfbfed1547d4167a9836fa2942a97 (diff)
downloadqtlocation-mapboxgl-e2bcea90fce8a1e05e517c615d21d845e955f53d.tar.gz
[core] use #pragma once instead of ifdef include guards
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-shaders.py7
-rwxr-xr-xscripts/build-version.py9
2 files changed, 5 insertions, 11 deletions
diff --git a/scripts/build-shaders.py b/scripts/build-shaders.py
index 4cfb3cb384..228ba65112 100755
--- a/scripts/build-shaders.py
+++ b/scripts/build-shaders.py
@@ -18,10 +18,9 @@ shader_name, shader_type, extension = os.path.basename(input_file).split('.')
with open(input_file, "r") as f:
data = f.read()
-content = """// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
+content = """#pragma once
-#ifndef MBGL_SHADER_{NAME}_{TYPE}
-#define MBGL_SHADER_{NAME}_{TYPE}
+// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
#include <mbgl/gl/gl.hpp>
@@ -38,8 +37,6 @@ constexpr const char* {type} = R"MBGL_SHADER(#version 120\n{data})MBGL_SHADER";
}} // namespace {name}
}} // namespace shaders
}} // namespace mbgl
-
-#endif
""".format(
name = shader_name,
NAME = shader_name.upper(),
diff --git a/scripts/build-version.py b/scripts/build-version.py
index 1a01f6cd2b..a39639007d 100755
--- a/scripts/build-version.py
+++ b/scripts/build-version.py
@@ -44,8 +44,7 @@ else:
rev = DEFAULT_REV
header = """// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED.
-#ifndef MBGL_UTIL_VERSION
-#define MBGL_UTIL_VERSION
+#pragma once
#define MBGL_VERSION 0x{major:02x}{minor:02x}{patch:02x}
#define MBGL_VERSION_STRING "{major}.{minor}.{patch}"
@@ -62,10 +61,8 @@ extern const char *revision;
extern const char *string;
extern const unsigned int number;
-}}
-}}
-
-#endif
+}} // namespace mbgl
+}} // namespace version
""".format(
major = tag[0],
minor = tag[1],