aboutsummaryrefslogtreecommitdiff
path: root/src/proj_internal.h
diff options
context:
space:
mode:
authorAaron Puchert <aaron.puchert@sap.com>2017-10-20 12:58:10 +0200
committerAaron Puchert <aaron.puchert@sap.com>2017-11-27 14:57:42 +0100
commit3175dce5fcec54fef6299cc8b595d84db5b29cf4 (patch)
tree0c82ae4f4afa9eb44893e1bd7d1f9a884459e2d9 /src/proj_internal.h
parent1f48f4c333bfe135296d3be643ef4981dc401c38 (diff)
downloadPROJ-3175dce5fcec54fef6299cc8b595d84db5b29cf4.tar.gz
PROJ-3175dce5fcec54fef6299cc8b595d84db5b29cf4.zip
Replace some asserts by compile-time assertions
Decisions regarding the size of certain types are always made at compile time, hence this is where the assertion should take place. If the assertions fail, there is now a compiler error.
Diffstat (limited to 'src/proj_internal.h')
-rw-r--r--src/proj_internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/proj_internal.h b/src/proj_internal.h
index fd6dc75d..4e70e690 100644
--- a/src/proj_internal.h
+++ b/src/proj_internal.h
@@ -48,6 +48,8 @@
extern "C" {
#endif
+#define STATIC_ASSERT(COND) ((void)sizeof(char[(COND) ? 1 : -1]))
+
#ifndef PJ_TODEG
#define PJ_TODEG(rad) ((rad)*180.0/M_PI)
#endif