From 2f26d3a94a9ffa98047e75673ec27ad5394b772a Mon Sep 17 00:00:00 2001 From: SASANO Takayoshi Date: Tue, 7 Apr 2020 18:33:26 +0900 Subject: [PATCH] add OpenBSD support - use default compiler (clang) instead of gcc - add required header file - fix for clang's isdigit() return value --- ambed/main.h | 2 ++ ambed/makefile | 2 +- ambedtest/main.h | 2 ++ ambedtest/makefile | 2 +- src/cdmriddir.cpp | 5 ++++- src/main.h | 2 ++ src/makefile | 2 +- 7 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ambed/main.h b/ambed/main.h index 364bb93..bd36661 100644 --- a/ambed/main.h +++ b/ambed/main.h @@ -41,6 +41,8 @@ #include #include #include +#include +#include //////////////////////////////////////////////////////////////////////////////////////// // defines diff --git a/ambed/makefile b/ambed/makefile index c556a28..c9a1e5e 100644 --- a/ambed/makefile +++ b/ambed/makefile @@ -1,4 +1,4 @@ -CC=g++ +CC=c++ CFLAGS=-c -std=c++11 -pthread LDFLAGS=-std=c++11 -pthread SOURCES=$(wildcard *.cpp) diff --git a/ambedtest/main.h b/ambedtest/main.h index b6bc7ed..df74616 100644 --- a/ambedtest/main.h +++ b/ambedtest/main.h @@ -41,6 +41,8 @@ #include #include #include +#include +#include //////////////////////////////////////////////////////////////////////////////////////// // defines diff --git a/ambedtest/makefile b/ambedtest/makefile index bc1a804..874504f 100644 --- a/ambedtest/makefile +++ b/ambedtest/makefile @@ -1,4 +1,4 @@ -CC=g++ +CC=c++ CFLAGS=-c -std=c++11 -pthread LDFLAGS=-std=c++11 -pthread SOURCES=$(wildcard *.cpp) diff --git a/src/cdmriddir.cpp b/src/cdmriddir.cpp index 5d62db3..9887d2f 100644 --- a/src/cdmriddir.cpp +++ b/src/cdmriddir.cpp @@ -152,7 +152,10 @@ bool CDmridDir::IsValidDmrid(const char *sz) ok = true; for ( size_t i = 0; (i < n) && ok; i++ ) { - ok &= ::isdigit(sz[i]); + if ( !::isdigit(sz[i]) ) + { + ok = false; + } } } return ok; diff --git a/src/main.h b/src/main.h index 03c3af1..9c3f62b 100644 --- a/src/main.h +++ b/src/main.h @@ -41,6 +41,8 @@ #include #include #include +#include +#include //////////////////////////////////////////////////////////////////////////////////////// // defines diff --git a/src/makefile b/src/makefile index de1e0db..5946b6e 100644 --- a/src/makefile +++ b/src/makefile @@ -1,4 +1,4 @@ -CC=g++ +CC=c++ CFLAGS=-c -std=c++11 -pthread LDFLAGS=-std=c++11 -pthread SOURCES=$(wildcard *.cpp)