From dcaf5315a4237538ce6a3faa55e624a730b42e09 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Wed, 14 May 2014 14:27:08 +0200 Subject: [PATCH] Fix header guard names; other macros --- xbob/io/base/codec.cpp | 2 +- xbob/io/base/file.cpp | 2 +- xbob/io/base/hdf5.cpp | 2 +- xbob/io/base/include/xbob.io.base/api.h | 22 +++++++++++----------- xbob/io/base/include/xbob.io.base/config.h | 10 +++++----- xbob/io/base/main.cpp | 6 +++--- xbob/io/base/version.cpp | 4 ++-- xbob/io/base/videoreader.cpp | 2 +- xbob/io/base/videowriter.cpp | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/xbob/io/base/codec.cpp b/xbob/io/base/codec.cpp index 67a5c27..2e50351 100644 --- a/xbob/io/base/codec.cpp +++ b/xbob/io/base/codec.cpp @@ -5,7 +5,7 @@ * @brief Bindings to bob::io::CodecRegistry */ -#define XBOB_IO_MODULE +#define XBOB_IO_BASE_MODULE #include <xbob.io.base/api.h> int PyBobIoCodec_Register (const char* extension, const char* description, bob::io::file_factory_t factory) { diff --git a/xbob/io/base/file.cpp b/xbob/io/base/file.cpp index c3a3ebd..8974bc1 100644 --- a/xbob/io/base/file.cpp +++ b/xbob/io/base/file.cpp @@ -5,7 +5,7 @@ * @brief Bindings to bob::io::File */ -#define XBOB_IO_MODULE +#define XBOB_IO_BASE_MODULE #include "bobskin.h" #include <xbob.io.base/api.h> #include <bob/io/CodecRegistry.h> diff --git a/xbob/io/base/hdf5.cpp b/xbob/io/base/hdf5.cpp index 8a4cd93..4b84da7 100644 --- a/xbob/io/base/hdf5.cpp +++ b/xbob/io/base/hdf5.cpp @@ -5,7 +5,7 @@ * @brief Bindings to bob::io::HDF5File */ -#define XBOB_IO_MODULE +#define XBOB_IO_BASE_MODULE #include <xbob.io.base/api.h> #include <boost/make_shared.hpp> diff --git a/xbob/io/base/include/xbob.io.base/api.h b/xbob/io/base/include/xbob.io.base/api.h index cab9c10..081d13d 100644 --- a/xbob/io/base/include/xbob.io.base/api.h +++ b/xbob/io/base/include/xbob.io.base/api.h @@ -5,13 +5,13 @@ * @brief C/C++ API for bob::io */ -#ifndef XBOB_IO_H -#define XBOB_IO_H +#ifndef XBOB_IO_BASE_H +#define XBOB_IO_BASE_H /* Define Module Name and Prefix for other Modules Note: We cannot use XBOB_EXT_* macros here, unfortunately */ -#define XBOB_IO_PREFIX "xbob.io.base" -#define XBOB_IO_FULL_NAME "xbob.io.base._library" +#define XBOB_IO_BASE_PREFIX "xbob.io.base" +#define XBOB_IO_BASE_FULL_NAME "xbob.io.base._library" #include <Python.h> @@ -181,7 +181,7 @@ typedef struct { #endif /* WITH_FFMPEG */ -#ifdef XBOB_IO_MODULE +#ifdef XBOB_IO_BASE_MODULE /* This section is used when compiling `xbob.io.base' itself */ @@ -323,7 +323,7 @@ typedef struct { PyObject *c_api_object; PyObject *module; - module = PyImport_ImportModule(XBOB_IO_FULL_NAME); + module = PyImport_ImportModule(XBOB_IO_BASE_FULL_NAME); if (module == NULL) return -1; @@ -355,15 +355,15 @@ typedef struct { # else "cobject" # endif - " at `" XBOB_IO_FULL_NAME "._C_API'"); + " at `" XBOB_IO_BASE_FULL_NAME "._C_API'"); return -1; } /* Checks that the imported version matches the compiled version */ int imported_version = *(int*)PyXbobIo_API[PyXbobIo_APIVersion_NUM]; - if (XBOB_IO_API_VERSION != imported_version) { - PyErr_Format(PyExc_ImportError, XBOB_IO_FULL_NAME " import error: you compiled against API version 0x%04x, but are now importing an API with version 0x%04x which is not compatible - check your Python runtime environment for errors", XBOB_IO_API_VERSION, imported_version); + if (XBOB_IO_BASE_API_VERSION != imported_version) { + PyErr_Format(PyExc_ImportError, XBOB_IO_BASE_FULL_NAME " import error: you compiled against API version 0x%04x, but are now importing an API with version 0x%04x which is not compatible - check your Python runtime environment for errors", XBOB_IO_BASE_API_VERSION, imported_version); return -1; } @@ -374,6 +374,6 @@ typedef struct { # endif //!defined(NO_IMPORT_ARRAY) -#endif /* XBOB_IO_MODULE */ +#endif /* XBOB_IO_BASE_MODULE */ -#endif /* XBOB_IO_H */ +#endif /* XBOB_IO_BASE_H */ diff --git a/xbob/io/base/include/xbob.io.base/config.h b/xbob/io/base/include/xbob.io.base/config.h index 98bb1b7..0305b45 100644 --- a/xbob/io/base/include/xbob.io.base/config.h +++ b/xbob/io/base/include/xbob.io.base/config.h @@ -1,14 +1,14 @@ /** * @author Andre Anjos <andre.anjos@idiap.ch> - * @date Fri 1 Nov 07:10:59 2013 + * @date Fri 1 Nov 07:10:59 2013 * * @brief General directives for all modules in xbob.io */ -#ifndef XBOB_IO_CONFIG_H -#define XBOB_IO_CONFIG_H +#ifndef XBOB_IO_BASE_CONFIG_H +#define XBOB_IO_BASE_CONFIG_H /* Macros that define versions and important names */ -#define XBOB_IO_API_VERSION 0x0200 +#define XBOB_IO_BASE_API_VERSION 0x0200 -#endif /* XBOB_IO_CONFIG_H */ +#endif /* XBOB_IO_BASE_CONFIG_H */ diff --git a/xbob/io/base/main.cpp b/xbob/io/base/main.cpp index b890c7f..0d2c460 100644 --- a/xbob/io/base/main.cpp +++ b/xbob/io/base/main.cpp @@ -5,7 +5,7 @@ * @brief Bindings to bob::io */ -#define XBOB_IO_MODULE +#define XBOB_IO_BASE_MODULE #include <xbob.io.base/api.h> #ifdef NO_IMPORT_ARRAY @@ -20,7 +20,7 @@ static PyMethodDef module_methods[] = { PyDoc_STRVAR(module_docstr, "bob::io classes and methods"); -int PyXbobIo_APIVersion = XBOB_IO_API_VERSION; +int PyXbobIo_APIVersion = XBOB_IO_BASE_API_VERSION; #if PY_VERSION_HEX >= 0x03000000 static PyModuleDef module_definition = { @@ -64,7 +64,7 @@ static PyObject* create_module (void) { auto m_ = make_safe(m); /* register some constants */ - if (PyModule_AddIntConstant(m, "__api_version__", XBOB_IO_API_VERSION) < 0) return 0; + if (PyModule_AddIntConstant(m, "__api_version__", XBOB_IO_BASE_API_VERSION) < 0) return 0; if (PyModule_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0) return 0; /* register the types to python */ diff --git a/xbob/io/base/version.cpp b/xbob/io/base/version.cpp index 0b7eae2..977d8a6 100644 --- a/xbob/io/base/version.cpp +++ b/xbob/io/base/version.cpp @@ -10,7 +10,7 @@ #ifdef NO_IMPORT_ARRAY #undef NO_IMPORT_ARRAY #endif -#define XBOB_IO_MODULE +#define XBOB_IO_BASE_MODULE #include <xbob.io.base/config.h> #include <string> @@ -932,7 +932,7 @@ static PyObject* create_module (void) { auto m_ = make_safe(m); ///< protects against early returns /* register version numbers and constants */ - if (PyModule_AddIntConstant(m, "api", XBOB_IO_API_VERSION) < 0) + if (PyModule_AddIntConstant(m, "api", XBOB_IO_BASE_API_VERSION) < 0) return 0; if (PyModule_AddStringConstant(m, "module", XBOB_EXT_MODULE_VERSION) < 0) return 0; diff --git a/xbob/io/base/videoreader.cpp b/xbob/io/base/videoreader.cpp index 7aa0c08..837d0f6 100644 --- a/xbob/io/base/videoreader.cpp +++ b/xbob/io/base/videoreader.cpp @@ -5,7 +5,7 @@ * @brief Bindings to bob::io::VideoReader */ -#define XBOB_IO_MODULE +#define XBOB_IO_BASE_MODULE #include "bobskin.h" #include <xbob.io.base/api.h> diff --git a/xbob/io/base/videowriter.cpp b/xbob/io/base/videowriter.cpp index 1f26aab..2261774 100644 --- a/xbob/io/base/videowriter.cpp +++ b/xbob/io/base/videowriter.cpp @@ -5,7 +5,7 @@ * @brief Bindings to bob::io::VideoWriter */ -#define XBOB_IO_MODULE +#define XBOB_IO_BASE_MODULE #include "bobskin.h" #include <xbob.io.base/api.h> -- GitLab