aslze / asl

A compact C++ cross-platform library including JSON, XML, HTTP, Sockets, WebSockets, threads, processes, logs, file system, CSV, INI files, vectors and matrices, etc.
Other
68 stars 17 forks source link

Failed to build on FreeBSD #29

Closed Curculigo closed 2 months ago

Curculigo commented 3 months ago
$ cmake -S . -B build
-- The C compiler identification is Clang 18.1.5
-- The CXX compiler identification is Clang 18.1.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Configuring done (4.1s)
-- Generating done (0.0s)
-- Build files have been written to: /work/asl/build
$ gmake -C build
gmake: Entering directory '/work/asl/build'
[  1%] Building CXX object src/CMakeFiles/asls.dir/String.cpp.o
[  3%] Building CXX object src/CMakeFiles/asls.dir/Socket.cpp.o
[  5%] Building CXX object src/CMakeFiles/asls.dir/SocketServer.cpp.o
[  7%] Building CXX object src/CMakeFiles/asls.dir/MulticastSocket.cpp.o
[  8%] Building CXX object src/CMakeFiles/asls.dir/HttpServer.cpp.o
[ 10%] Building CXX object src/CMakeFiles/asls.dir/Http.cpp.o
[ 12%] Building CXX object src/CMakeFiles/asls.dir/WebSocket.cpp.o
[ 14%] Building CXX object src/CMakeFiles/asls.dir/Xdl.cpp.o
[ 16%] Building CXX object src/CMakeFiles/asls.dir/Var.cpp.o
[ 17%] Building CXX object src/CMakeFiles/asls.dir/Xml.cpp.o
[ 19%] Building CXX object src/CMakeFiles/asls.dir/IniFile.cpp.o
[ 21%] Building CXX object src/CMakeFiles/asls.dir/File.cpp.o
[ 23%] Building CXX object src/CMakeFiles/asls.dir/TextFile.cpp.o
[ 25%] Building CXX object src/CMakeFiles/asls.dir/Directory.cpp.o
[ 26%] Building CXX object src/CMakeFiles/asls.dir/Path.cpp.o
[ 28%] Building CXX object src/CMakeFiles/asls.dir/Date.cpp.o
[ 30%] Building CXX object src/CMakeFiles/asls.dir/Process.cpp.o
[ 32%] Building CXX object src/CMakeFiles/asls.dir/Console.cpp.o
[ 33%] Building CXX object src/CMakeFiles/asls.dir/Log.cpp.o
[ 35%] Building CXX object src/CMakeFiles/asls.dir/TabularDataFile.cpp.o
/work/asl/src/TabularDataFile.cpp:15:39: error: too many arguments provided to function-like macro invocation
   15 | inline bool isnumber(const String& s, char dec)
      |                                       ^
/usr/include/ctype.h:130:9: note: macro 'isnumber' defined here
  130 | #define isnumber(c)     __sbistype((c), _CTYPE_D|_CTYPE_N)
      |         ^
/work/asl/src/TabularDataFile.cpp:15:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
   15 | inline bool isnumber(const String& s, char dec)
      | ^
/work/asl/src/TabularDataFile.cpp:17:2: error: expected expression
   17 |         const char* p = s.data();
      |         ^
/work/asl/src/TabularDataFile.cpp:28:2: error: expected ';' after top level declarator
   28 | }
      |  ^
      |  ;
/work/asl/src/TabularDataFile.cpp:334:20: error: too many arguments provided to function-like macro invocation
  334 |                         if (isnumber(v, decimal))
      |                                         ^
/usr/include/ctype.h:130:9: note: macro 'isnumber' defined here
  130 | #define isnumber(c)     __sbistype((c), _CTYPE_D|_CTYPE_N)
      |         ^
1 warning and 4 errors generated.
gmake[2]: *** [src/CMakeFiles/asls.dir/build.make:342: src/CMakeFiles/asls.dir/TabularDataFile.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:100: src/CMakeFiles/asls.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
gmake: Leaving directory '/work/asl/build'
aslze commented 2 months ago

Seems easy to fix. There is a clash with a predefined macro in that build system, but I won't be available for a few weeks.

aslze commented 2 months ago

Can you try current master version?

Curculigo commented 2 months ago

The problem is fixed. Thank you.