From 0fe5589d70296e9dbd0c603688e7eafec61c1d0f Mon Sep 17 00:00:00 2001 From: nishi Date: Wed, 29 May 2024 05:01:00 +0000 Subject: [PATCH] add support git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@134 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- Client/main.c | 3 +++ Library/dataworks.c | 11 +++++++++++ Library/dataworks.h | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/Client/main.c b/Client/main.c index c78c28c..a0dfbce 100644 --- a/Client/main.c +++ b/Client/main.c @@ -130,6 +130,9 @@ int main(int argc, char** argv) { printf("This system is big-endian.\n"); } printf("\n"); + if(!dataworks_get_if_supported()){ + printf("!!! THIS PLATFORM IS UNSUPPORTED! !!!\n\n"); + } printf("%s\n", dataworks_get_copyright()); printf("All rights reserved.\n"); } diff --git a/Library/dataworks.c b/Library/dataworks.c index 8976cee..12c7b87 100644 --- a/Library/dataworks.c +++ b/Library/dataworks.c @@ -28,12 +28,15 @@ #include "dataworks.h" +#include + const char* dataworks_version = "0.0.0"; const char* dataworks_compile_date = __DATE__; const char* dataworks_copyright = "Copyright (c) Crabware 2024\n" " Crabware is the software-development division of\n" " Hinode Gakuen PC-Club. Contact: "; +#define SUPPORTED #if defined(__MINGW32__) const char* dataworks_platform = "Windows/" #elif defined(__NetBSD__) @@ -45,6 +48,7 @@ const char* dataworks_platform = "Linux/" #elif defined(__WATCOMC__) const char* dataworks_platform = "WatcomC/" #else +#undef SUPPORTED const char* dataworks_platform = "Unknown/" #endif PLATFORM_M " (" PLATFORM_P ")"; @@ -58,3 +62,10 @@ char dataworks_get_endian(void) { } const char* dataworks_get_copyright(void) { return dataworks_copyright; } +bool dataworks_get_if_supported(void){ +#ifdef SUPPORTED + return true; +#else + return false; +#endif +} diff --git a/Library/dataworks.h b/Library/dataworks.h index 4484877..8d6da92 100644 --- a/Library/dataworks.h +++ b/Library/dataworks.h @@ -40,6 +40,8 @@ extern "C" { #endif +#include + /** * @~english * @brief Get the version of DataWorks @@ -80,6 +82,14 @@ char dataworks_get_endian(void); */ const char* dataworks_get_copyright(void); +/** + * @~english + * @brief Get if your platform is supported or not + * @return Supported or not + * + */ +bool dataworks_get_if_supported(void); + #ifdef __cplusplus } #endif -- 2.43.0