diff --git a/python/templates/MutableObject.cc.jinja2 b/python/templates/MutableObject.cc.jinja2 index edbca8da9..bb851a48c 100644 --- a/python/templates/MutableObject.cc.jinja2 +++ b/python/templates/MutableObject.cc.jinja2 @@ -8,7 +8,7 @@ {{ include }} {% endfor %} -#ifdef PODIO_JSON_OUTPUT && !defined(__CLING__) +#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__) #include "nlohmann/json.hpp" #endif diff --git a/python/templates/MutableObject.h.jinja2 b/python/templates/MutableObject.h.jinja2 index b34b63a58..649147201 100644 --- a/python/templates/MutableObject.h.jinja2 +++ b/python/templates/MutableObject.h.jinja2 @@ -16,7 +16,7 @@ #include #include -#ifdef PODIO_JSON_OUTPUT +#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__) #include "nlohmann/json_fwd.hpp" #endif diff --git a/python/templates/Object.cc.jinja2 b/python/templates/Object.cc.jinja2 index 37414ec52..bbb8e8856 100644 --- a/python/templates/Object.cc.jinja2 +++ b/python/templates/Object.cc.jinja2 @@ -8,7 +8,7 @@ {{ include }} {% endfor %} -#ifdef PODIO_JSON_OUTPUT && !defined(__CLING__) +#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__) #include "nlohmann/json.hpp" #endif diff --git a/python/templates/Object.h.jinja2 b/python/templates/Object.h.jinja2 index 1e2562299..926158b5a 100644 --- a/python/templates/Object.h.jinja2 +++ b/python/templates/Object.h.jinja2 @@ -14,7 +14,7 @@ #include #include -#ifdef PODIO_JSON_OUTPUT && !defined(__CLING__) +#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__) #include "nlohmann/json_fwd.hpp" #endif diff --git a/python/templates/macros/declarations.jinja2 b/python/templates/macros/declarations.jinja2 index a0c976bc4..166b53121 100644 --- a/python/templates/macros/declarations.jinja2 +++ b/python/templates/macros/declarations.jinja2 @@ -134,7 +134,7 @@ {%- endmacro %} {% macro json_output(type, prefix='') %} -#ifdef PODIO_JSON_OUTPUT && !defined(__CLING__) +#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__) void to_json(nlohmann::json& j, const {{ prefix }}{{ type }}& value); #endif {% endmacro %} diff --git a/python/templates/macros/implementations.jinja2 b/python/templates/macros/implementations.jinja2 index 0ddb29e39..096a93ae5 100644 --- a/python/templates/macros/implementations.jinja2 +++ b/python/templates/macros/implementations.jinja2 @@ -210,7 +210,7 @@ std::ostream& operator<<(std::ostream& o, const {{ type }}& value) { {%- endmacro %} {% macro json_output(class, members, single_relations, multi_relations, vector_members, get_syntax, prefix='') %} -#ifdef PODIO_JSON_OUTPUT +#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__) void to_json(nlohmann::json& j, const {{ prefix }}{{ class.bare_type }}& value) { j = nlohmann::json{ {% set comma = joiner(",") %}