OSDN Git Service

Fixed compilation on FreeBSD (TrueOS) as well as OpenBSD and OpenSolaris (OpenIndiana).
authorLoRd_MuldeR <mulder2@gmx.de>
Sat, 15 Feb 2020 01:45:09 +0000 (02:45 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Sun, 16 Feb 2020 20:13:26 +0000 (21:13 +0100)
Makefile
README.md
frontend/src/main.cpp
frontend/src/self_test.cpp
frontend/src/sys_info.h

index 7c4d1a9..75cfaa8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,12 @@
 DEBUG ?= 0
 
 # -----------------------------------------------
+# TOOLS
+# -----------------------------------------------
+
+TAR ?= tar
+
+# -----------------------------------------------
 # SYSTEM DETECTION
 # -----------------------------------------------
 
@@ -51,10 +57,10 @@ all: $(TARFILE)
 clean: $(CLEANUP)
 
 $(TARFILE): $(SUBDIRS)
-       @printf "\033[1;36m===[Make package]===\033[0m\n" $@
+       @printf "\033[1;36m===[Make package]===\033[0m\n"
        @mkdir -p $(dir $@)
        rm -f $@
-       tar -czvf $@ COPYING.txt -C $(BINDIR) $(EXEFILE) BUILD_TAG.txt
+       $(TAR) -czvf $@ COPYING.txt -C $(BINDIR) $(EXEFILE) BUILD_TAG.txt
        @printf "\033[1;32mCompleted.\033[0m\n"
 
 $(SUBDIRS):
index 8259120..cf24b42 100644 (file)
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ MHash-384
 
 The MHash-384 core library has been written in plain **C**, and the CLI front-end has been written in **C++**. The core library provides a simple "stream processing" API, that is available in two flavors: a plain C99 version and an *object-oriented* C++ wrapper. Either way, the MHash-384 library produces hash values with a fixed length of 384 bits (48 bytes).
 
-MHash-384 supports a wide range of compilers, including MSVC++, GCC (MinGW/Cygwin), Clang/LLVM and Intel C++. It also runs on many platforms, including Windows and Linux. Furthermore, the MHash-384 library has already been *ported* to various other programming languages, including **Java**, **Microsoft.NET**, **Python** as well as **Delphi** and **Free Pascal**.
+MHash-384 supports a wide range of compilers, including MSVC++, GCC, MinGW/Cygwin, Clang/LLVM and Intel C++. It also runs on many platforms, including Windows, Linux, BSD and Solaris. Furthermore, the MHash-384 library has already been *ported* to various other programming languages, including **Java**, **Microsoft.NET**, **Python** as well as **Delphi**.
 
 
 # Quick Start Guide
@@ -417,6 +417,7 @@ MHash-384 has been tested to successfully build and run on (at least) the follow
     - Microsoft Visual C++, version 16.00 (Visual Studio 2010) or newer
     - Mingw-w64 (from MSYS2), tested with version 8.0.0, using GCC 9.2.0 or Clang 9.0.0
     - MinGW (mingw.org), tested with version 5.3.2, using GCC 8.2.0
+    - Cygwin, tested with version 3.1.2 (x64), using GCC 7.4.0 or Clang 8.0.1
 
 * **Linux/GNU (x86/x64)**
     - Ubuntu, tested with version 16.04 (Xenial), using GCC 5.4.0 or Clang 3.8.0
@@ -424,12 +425,18 @@ MHash-384 has been tested to successfully build and run on (at least) the follow
     - Manjaro, tested with version 18.1.5, using GCC 9.2.0 or Clang 9.0.1
     - openSUSE (Leap), tested with version 15.1, using GCC 7.5.0 or Clang 7.0.1
 
+* **BSD-Family (x86/x64)**
+    - FreeBSD, tested with TrueOS version 18.12, using GCC 7.4.0 or Clang 7.0.1
+    - OpenBSD, tested with version 6.6, using GCC 8.2.0 or Clang 8.0.1
+
+* **Solaris (x86/x64)**
+    - OpenSolaris/Illumos, tested with OpenIndiana version 2019.10, using GCC 9.2.0
+
 ## Ports to other lanuguages
 
 * **Java**
     - Java SE 8, tested with OpenJDK Runtime Environment 1.8.0_242
     - Java SE 11, tested with OpenJDK Runtime Environment 11.0.5
-    - Java SE 13, tested with OpenJDK Runtime Environment 13.0.2
 
 * **.NET Framework**
     - Microsoft.NET Framework 4.5 (or newer), tested with Visual Studio 2019 (version 15.9.20)
index 25feb6c..f6a288d 100644 (file)
@@ -25,6 +25,7 @@
 #include "sys_info.h"
 #include <ctime>
 #include <sys/stat.h>
+#include <errno.h>
 
 /* Win32 I/O stuff */
 #ifdef _WIN32
@@ -159,7 +160,8 @@ static opmode_t parse_options(int &arg_offset, options_t &options, const int arg
                else
                {
                        print_logo();
-                       FPRINTF(stderr, STR("Error: Specified option \"%") PRI_CHAR STR("\" is unknown. Please type \"--help\" for details!\n"), argv[arg_offset]);
+                       FPRINTF(stderr, STR("Error: Specified option \"%") PRI_CHAR STR("\" is unknown!\n"), argv[arg_offset]);
+                       FPRINTF(stderr, STR("Type \"%") PRI_CHAR STR(" --help\" for a list of available options...\n"), argv[0U]);
                        fflush(stderr);
                        return MODE_UNKNOWN;
                }
index ad5c330..4c384e8 100644 (file)
@@ -26,6 +26,7 @@
 #include <unordered_set>
 #include <array>
 #include <algorithm>
+#include <errno.h>
 
 /*
  * Test-case specification
index 53825d7..31d27ba 100644 (file)
  * Detect operating system
  */
 #if defined(_WIN32)
-#      define SYSTEM_NAME "Win"
+#      define SYSTEM_NAME "Windows"
 #elif defined(__CYGWIN__)
 #      define SYSTEM_NAME "Cygwin"
 #elif defined(__linux__)
 #      define SYSTEM_NAME "Linux"
+#elif defined(__FreeBSD__)
+#      define SYSTEM_NAME "FreeBSD"
+#elif defined(__NetBSD__)
+#      define SYSTEM_NAME "NetBSD"
+#elif defined(__OpenBSD__)
+#      define SYSTEM_NAME "OpenBSD"
+#elif defined(__sun)
+#      define SYSTEM_NAME "Solaris"
+#elif defined(__unix__)
+#      define SYSTEM_NAME "Unix"
 #else
 #      error Unknonw platform!
 #endif