Revision: 76042
http://sourceforge.net/p/brlcad/code/76042
Author: starseeker
Date: 2020-06-06 15:43:48 +0000 (Sat, 06 Jun 2020)
Log Message:
-----------
Add define-checking messages for other compile-time API headers.
Modified Paths:
--------------
brlcad/trunk/CMakeLists.txt
brlcad/trunk/include/brlcad_ident.h.in
Modified: brlcad/trunk/CMakeLists.txt
===================================================================
--- brlcad/trunk/CMakeLists.txt 2020-06-06 15:15:13 UTC (rev 76041)
+++ brlcad/trunk/CMakeLists.txt 2020-06-06 15:43:48 UTC (rev 76042)
@@ -972,6 +972,12 @@
endif(NOT COMMAND CONFIG_H_APPEND)
CONFIG_H_APPEND(BRLCAD "/**** Define statements for CMake ****/\n")
+CONFIG_H_APPEND(BRLCAD "#if !defined(BRLCADBUILD)\n")
+CONFIG_H_APPEND(BRLCAD " # pragma message \"Warning: included
brlcad_config.h (compile-time API) without BRLCADBUILD defined\"\n")
+CONFIG_H_APPEND(BRLCAD "#endif\n")
+CONFIG_H_APPEND(BRLCAD "#if !defined(HAVE_CONFIG_H)\n")
+CONFIG_H_APPEND(BRLCAD " # pragma message \"Warning: included
brlcad_config.h (compile-time API) without HAVE_CONFIG_H defined\"\n")
+CONFIG_H_APPEND(BRLCAD "#endif\n")
CONFIG_H_APPEND(BRLCAD "#ifndef __CONFIG_H__\n")
CONFIG_H_APPEND(BRLCAD "#define __CONFIG_H__\n")
Modified: brlcad/trunk/include/brlcad_ident.h.in
===================================================================
--- brlcad/trunk/include/brlcad_ident.h.in 2020-06-06 15:15:13 UTC (rev
76041)
+++ brlcad/trunk/include/brlcad_ident.h.in 2020-06-06 15:43:48 UTC (rev
76042)
@@ -34,6 +34,16 @@
#include "common.h"
+/* If the caller is not using this correctly per the above NOTE, issue a
+ * message about it but don't hault the build. Usage without defines set isn't
+ * correct, but will probably function anyway... */
+#if !defined(BRLCADBUILD)
+# pragma message "Warning: included brlcad_ident.h (compile-time API) without
BRLCADBUILD defined"
+#endif
+#if !defined(HAVE_CONFIG_H)
+# pragma message "Warning: included brlcad_ident.h (compile-time API) without
HAVE_CONFIG_H defined"
+#endif
+
/* for snprintf */
#include <stdio.h>
/* for strlen */
@@ -41,7 +51,6 @@
#include "brlcad_version.h"
-
/* Compilation Settings */
/**
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits