Skip to content

Commit

Permalink
Adhere to deprecated openPMD_Version method
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Nov 8, 2024
1 parent 56f8fe3 commit bbcd59c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
10 changes: 10 additions & 0 deletions include/openPMD/binding/c/auxiliary/deprecate.h
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion include/openPMD/binding/c/version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef OPENPMD_VERSION_H
#define OPENPMD_VERSION_H

#include "openPMD/binding/c/auxiliary/deprecate.h"

#include <stdbool.h>

#ifdef __cplusplus
Expand All @@ -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
{
Expand Down
14 changes: 13 additions & 1 deletion src/binding/c/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit bbcd59c

Please sign in to comment.