diff OrthancFramework/Sources/SQLite/Connection.h @ 5357:fddb5d8d0021

Prevent the leak of the full path of the source files in the binaries
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 06 Jul 2023 17:04:31 +0200
parents 0ea402b4d901
children 48b8dae6dc77
line wrap: on
line diff
--- a/OrthancFramework/Sources/SQLite/Connection.h	Tue Jul 04 18:39:52 2023 +0200
+++ b/OrthancFramework/Sources/SQLite/Connection.h	Thu Jul 06 17:04:31 2023 +0200
@@ -46,7 +46,16 @@
 #include <string>
 #include <map>
 
-#define SQLITE_FROM_HERE ::Orthanc::SQLite::StatementId(__FILE__, __LINE__)
+#if !defined(__ORTHANC_FILE__)
+#  if defined(_MSC_VER)
+#    pragma message("Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries")
+#  else
+#    warning Warning: Macro __ORTHANC_FILE__ is not defined, this will leak the full path of the source files in the binaries
+#  endif
+#  define __ORTHANC_FILE__ __FILE__
+#endif
+
+#define SQLITE_FROM_HERE ::Orthanc::SQLite::StatementId(__ORTHANC_FILE__, __LINE__)
 
 namespace Orthanc
 {