diff --git a/bob/io/base/__init__.py b/bob/io/base/__init__.py
index 74a868d59514759d28ad1e2cadf58d81504c21a1..48ee091f5ebaa07ea5f8ecaa2286017dfda581ad 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('_')]