]> Nishi Git Mirror - dataworks.git/commitdiff
add support
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 29 May 2024 05:01:00 +0000 (05:01 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Wed, 29 May 2024 05:01:00 +0000 (05:01 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@134 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

Client/main.c
Library/dataworks.c
Library/dataworks.h

index c78c28cd5a461be4d6deda89b1da22190be22275..a0dfbce35448379fa57e99df0d785487017e3238 100644 (file)
@@ -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");
        }
index 8976ceeb7369cc611aa3282f2eb85da45d528b6e..12c7b870408367fc62c0ab0db5474cc14a7c3d22 100644 (file)
 
 #include "dataworks.h"
 
+#include <stdbool.h>
+
 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: <nishi@nishi.boats>";
 
+#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
+}
index 44848777e2ce4549e930af011459a017d0c2aa65..8d6da921b53aaae115176c4ed52d225c7ce04966 100644 (file)
@@ -40,6 +40,8 @@
 extern "C" {
 #endif
 
+#include <stdbool.h>
+
 /**
  * @~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