64 lines
2.0 KiB
C
64 lines
2.0 KiB
C
#ifndef __CELOXICA_ADE_VERSION_H__
|
|
#define __CELOXICA_ADE_VERSION_H__
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif /* __cplusplus */
|
|
|
|
/**
|
|
* \brief Version and Build numbers for ADE headers.
|
|
*/
|
|
#define CELOXICA_ADE_VERSION "5.69"
|
|
#define CELOXICA_ADE_BUILD_NUMBER "r2017-1.1"
|
|
#define CELOXICA_ADE_RELEASE_YEAR 2017
|
|
#define CELOXICA_ADE_RELEASE_MAJOR 1
|
|
#define CELOXICA_ADE_RELEASE_MINOR 1
|
|
#define CELOXICA_ADE_RELEASE_MAINTENANCE 0
|
|
|
|
/**
|
|
* \brief Returns the Version and Build numbers for ADE library.
|
|
*/
|
|
extern char const* ADEGetVersion();
|
|
extern char const* ADEGetBuildNumber();
|
|
|
|
/**
|
|
* \brief Checks for mismatches between ADE library and header's Version and Build numbers.
|
|
*/
|
|
extern int __ADECheckVersion(char const* const clientVersion, char const* const clientBuildNumber);
|
|
static inline int ADECheckVersion()
|
|
{
|
|
return __ADECheckVersion(CELOXICA_ADE_VERSION, CELOXICA_ADE_BUILD_NUMBER);
|
|
}
|
|
|
|
/**
|
|
* \brief Internal check function between ADE libraries.
|
|
*/
|
|
static inline int __ADECheckVersionBetween(char const* const libraryName, char const* const clientName, char const* const clientVersion, char const* const clientBuildNumber)
|
|
{
|
|
if (strcmp(clientVersion, CELOXICA_ADE_VERSION))
|
|
{
|
|
fprintf(stderr, "ADE: [VERSION] version number mismatch (%s: %s build %s, %s: %s build %s)\n", clientName, clientVersion, clientBuildNumber, libraryName, CELOXICA_ADE_VERSION, CELOXICA_ADE_BUILD_NUMBER);
|
|
return -1;
|
|
}
|
|
|
|
if (strcmp(clientBuildNumber, CELOXICA_ADE_BUILD_NUMBER))
|
|
{
|
|
fprintf(stderr, "ADE: [VERSION] build number mismatch (%s: %s build %s, %s: %s build %s)\n", clientName, clientVersion, clientBuildNumber, libraryName, CELOXICA_ADE_VERSION, CELOXICA_ADE_BUILD_NUMBER);
|
|
return 1;
|
|
}
|
|
|
|
fprintf(stderr, "ADE: [VERSION] using %s version %s build %s\n", libraryName, CELOXICA_ADE_VERSION, CELOXICA_ADE_BUILD_NUMBER);
|
|
return 0;
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* __CELOXICA_ADE_VERSION_H__ */
|