From 33e5937d0080c45ec682f05c3fe85e31377703e1 Mon Sep 17 00:00:00 2001
From: Manuel Gunther <siebenkopf@googlemail.com>
Date: Tue, 24 May 2016 17:41:36 -0600
Subject: [PATCH] Added get_macros function

---
 bob/io/base/__init__.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/bob/io/base/__init__.py b/bob/io/base/__init__.py
index 74a868d..48ee091 100644
--- a/bob/io/base/__init__.py
+++ b/bob/io/base/__init__.py
@@ -263,6 +263,23 @@ def get_include_directories():
     return pkg.include_directories()
 
 
+def get_macros():
+  """get_macros() -> macros
+
+  Returns a list of preprocessor macros, such as ``(HAVE_HDF5, 1)``.
+  This function is automatically used by :py:func:`bob.extension.get_bob_libraries` to retrieve the prerpocessor definitions that are required to use the C bindings of this library in dependent classes.
+  You shouldn't normally need to call this function by hand.
+
+  **Returns:**
+
+  ``macros`` : [(str,str)]
+    The list of preprocessor macros required to use the C bindings of this class.
+    For now, only ``('HAVE_HDF5', '1')`` is returned, when applicable.
+  """
+  # get include directories
+  if get_include_directories():
+    return [('HAVE_HDF5','1')]
+
 
 # gets sphinx autodoc done right - don't remove it
 __all__ = [_ for _ in dir() if not _.startswith('_')]
-- 
GitLab