From eeab8e18fe91e84007518b1fb742e8ba5f0ce72f Mon Sep 17 00:00:00 2001 From: Ian bell Date: Sat, 17 May 2014 19:54:28 +0200 Subject: [PATCH] Use cpversion.h instead of version.h to reduce name clashing in headers Signed-off-by: Ian bell --- dev/generate_headers.py | 10 +++++----- src/CoolProp.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/generate_headers.py b/dev/generate_headers.py index 3ed8dfb9..e4df9189 100644 --- a/dev/generate_headers.py +++ b/dev/generate_headers.py @@ -10,12 +10,12 @@ import os import sys def version_to_file(root_dir): - print('*** Generating version.h ***') + print('*** Generating cpversion.h ***') # Get the version from the version.txt file - version = open(os.path.join(root_dir,'version.txt'),'r').read().strip() + version = open(os.path.join(root_dir,'cpversion.txt'),'r').read().strip() # Format the string to be written - string_for_file = '//Generated by the preprocess.py script on {t:s}\n\nstatic char version [] ="{v:s}";'.format(t = str(datetime.now()),v = version) + string_for_file = '//Generated by the generate_headers.py script on {t:s}\n\nstatic char version [] ="{v:s}";'.format(t = str(datetime.now()),v = version) # Include path relative to the root include_dir = os.path.join(root_dir,'include') @@ -53,7 +53,7 @@ def gitrev_to_file(root_dir): if p.returncode != 0: print('tried to update git revision, but it failed for some reason (building from zip file?)') - gitstring = '//Generated by the preprocess.py script on {t:s}\n\n std::string gitrevision = \"???????\";' + gitstring = '//Generated by the generate_headers.py script on {t:s}\n\n std::string gitrevision = \"???????\";' f = open(os.path.join(include_dir,'gitrevision.h'),'w') f.write(gitstring) f.close() @@ -62,7 +62,7 @@ def gitrev_to_file(root_dir): rev = stdout.strip() print('git revision is', rev) - gitstring = '//Generated by the preprocess.py script on {t:s}\n\nstd::string gitrevision = \"{rev:s}\";'.format(t = str(datetime.now()), rev = rev) + gitstring = '//Generated by the generate_headers.py script on {t:s}\n\nstd::string gitrevision = \"{rev:s}\";'.format(t = str(datetime.now()), rev = rev) try: is_hash = rev.find(' ') == -1 # python 2.x diff --git a/src/CoolProp.cpp b/src/CoolProp.cpp index c6e10412..7efd078a 100644 --- a/src/CoolProp.cpp +++ b/src/CoolProp.cpp @@ -38,7 +38,7 @@ int get_debug_level(void){return debug_level;} //// This is very hacky, but pull the git revision from the file #include "gitrevision.h" // Contents are like "std::string gitrevision = "aa121435436ggregrea4t43t433";" -#include "version.h" // Contents are like "char version [] = "2.5";" +#include "cpversion.h" // Contents are like "char version [] = "2.5";" //int global_Phase = -1;