[osmpbf] 11/22: Use #define instead of const char* for version.

Bas Couwenberg sebastic at xs4all.nl
Sun Mar 16 10:08:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to tag v1.3.1
in repository osmpbf.

commit f84c2ea5e2d1c2269be7002d17490cbefded6d7f
Author: Jochen Topf <jochen at topf.org>
Date:   Mon Aug 26 10:30:39 2013 +0200

    Use #define instead of const char* for version.
    
    You can't initialize strings in header files, because they might be included from several source files and the linker will see several copies of the same string.
---
 include/osmpbf/osmpbf.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/osmpbf/osmpbf.h b/include/osmpbf/osmpbf.h
index e354907..9dd8de1 100644
--- a/include/osmpbf/osmpbf.h
+++ b/include/osmpbf/osmpbf.h
@@ -7,10 +7,9 @@
 // this describes the high-level OSM objects
 #include <osmpbf/osmformat.pb.h>
 
-namespace OSMPBF {
+#define OSMPBF_VERSION "1.3.0"
 
-    // library version
-    const char *version = "1.3.0";
+namespace OSMPBF {
 
     // the maximum size of a blob header in bytes
     const int max_blob_header_size = 64 * 1024; // 64 kB

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osmpbf.git



More information about the Pkg-grass-devel mailing list