diff options
-rw-r--r-- | python/brotlimodule.cc | 3 | ||||
-rw-r--r-- | setup.py | 4 | ||||
-rw-r--r-- | tools/version.h | 23 |
3 files changed, 26 insertions, 4 deletions
diff --git a/python/brotlimodule.cc b/python/brotlimodule.cc index 4294664..bc7ea08 100644 --- a/python/brotlimodule.cc +++ b/python/brotlimodule.cc @@ -3,14 +3,13 @@ #include <bytesobject.h> #include "../enc/encode.h" #include "../dec/decode.h" +#include "../tools/version.h" #if PY_MAJOR_VERSION >= 3 #define PyInt_Check PyLong_Check #define PyInt_AsLong PyLong_AsLong #endif -#define BROTLI_VERSION "0.1.0" - using namespace brotli; static PyObject *BrotliError; @@ -24,8 +24,8 @@ if platform.system() == 'Windows': def get_version(): - """ Return BROTLI_VERSION string as defined in 'brotlimodule.cc' file. """ - brotlimodule = os.path.join(CURR_DIR, 'python', 'brotlimodule.cc') + """ Return BROTLI_VERSION string as defined in 'tools/version.h' file. """ + brotlimodule = os.path.join(CURR_DIR, 'tools', 'version.h') with open(brotlimodule, 'r') as f: for line in f: m = re.match(r'#define\sBROTLI_VERSION\s"(.*)"', line) diff --git a/tools/version.h b/tools/version.h new file mode 100644 index 0000000..4532fcc --- /dev/null +++ b/tools/version.h @@ -0,0 +1,23 @@ +/* Copyright 2015 Google Inc. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Defines a common version string used by all of the brotli tools. +*/ + +#ifndef BROTLI_TOOLS_VERSION_H_ +#define BROTLI_TOOLS_VERSION_H_ + +#define BROTLI_VERSION "0.3.0" + +#endif /* BROTLI_TOOLS_VERSION_H_ */ |