diff --git a/include/openPMD/binding/c/auxiliary/deprecate.h b/include/openPMD/binding/c/auxiliary/deprecate.h new file mode 100644 index 0000000000..e6bc1f9328 --- /dev/null +++ b/include/openPMD/binding/c/auxiliary/deprecate.h @@ -0,0 +1,10 @@ +#ifndef OPENPMD_DEPRECATE_H +#define OPENPMD_DEPRECATE_H + +#ifndef _MSC_VER +#define OPENPMD_DEPRECATED __attribute__((deprecated)) +#else +#define OPENPMD_DEPRECATED +#endif + +#endif diff --git a/include/openPMD/binding/c/version.h b/include/openPMD/binding/c/version.h index a8c2f014c4..e1f63dcf5a 100644 --- a/include/openPMD/binding/c/version.h +++ b/include/openPMD/binding/c/version.h @@ -1,6 +1,8 @@ #ifndef OPENPMD_VERSION_H #define OPENPMD_VERSION_H +#include "openPMD/binding/c/auxiliary/deprecate.h" + #include #ifdef __cplusplus @@ -22,8 +24,10 @@ extern "C" extern const int openPMD_standard_min_patch; const char *openPMD_getVersion(); - const char *openPMD_getStandard(); + const char *OPENPMD_DEPRECATED openPMD_getStandard(); const char *openPMD_getStandardMinimum(); + const char *openPMD_getStandardDefault(); + const char *openPMD_getStandardMaximum(); typedef struct openPMD_Variant { diff --git a/src/binding/c/version.cpp b/src/binding/c/version.cpp index f2b17aa907..a1b6270b7f 100644 --- a/src/binding/c/version.cpp +++ b/src/binding/c/version.cpp @@ -26,7 +26,19 @@ const char *openPMD_getVersion() const char *openPMD_getStandard() { - static const std::string standard = openPMD::getStandard(); + static const std::string standard = openPMD::getStandardMaximum(); + return standard.c_str(); +} + +const char *openPMD_getStandardDefault() +{ + static const std::string standard = openPMD::getStandardDefault(); + return standard.c_str(); +} + +const char *openPMD_getStandardMaximum() +{ + static const std::string standard = openPMD::getStandardMaximum(); return standard.c_str(); }