From 2a293fb54b5d61318da721a6266e6cd645b5eb84 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Fri, 8 Sep 2023 09:56:36 +0200 Subject: [PATCH] Fix preprocessor directives --- python/templates/MutableObject.cc.jinja2 | 2 +- python/templates/MutableObject.h.jinja2 | 2 +- python/templates/Object.cc.jinja2 | 2 +- python/templates/Object.h.jinja2 | 2 +- python/templates/macros/declarations.jinja2 | 2 +- python/templates/macros/implementations.jinja2 | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) 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 b669a2b80..354db473d 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 bec9fc0da..742f7bbdc 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(",") %}