- The small operator function _N needs to be renamed, something is already defined to that name:
[ 66%] Building CXX object CMakeFiles/badlib.dir/src/assembler.cpp.o
/root/src/bass/src/assembler.cpp:189:19: error: expected identifier
Number operator"" _N(unsigned long long a)
^
/usr/include/ctype.h:47:12: note: expanded from macro '_N' #define _N 0x04 ^ /root/src/bass/src/assembler.cpp:198:20: error: no matching literal operator for
call to 'operator""_N' with argument of type 'unsigned long long' or
'const char *', and no matching literal operator template
{"A", 0_N}, {"X", 0_N}, {"Y", 0_N}, {"SR", 0_N},
Just renaming it to _NumOp and replacing the 7 occurrences on the lines following made it work.
- va_list from external/coreutils/.../log.h is named __va_list on OpenBSD, either detect the OS and change it, or include stdarg.h to define va_list.
Diff for both attached, seems to pass "make test" on both MacOS and OpenBSD, but markup seem to mangle it,
the patch is also available from c64/bass.patch
`diff --git a/external/coreutils/src/coreutils/log.h b/external/coreutils/src/coreutils/log.h
index 43a08e4..c5ef1b0 100644
--- a/external/coreutils/src/coreutils/log.h
+++ b/external/coreutils/src/coreutils/log.h
@@ -3,6 +3,7 @@
#include "format.h"
#include
#include
+#include <stdarg.h>
namespace logging {
diff --git a/src/assembler.cpp b/src/assembler.cpp
index 0e8767c..0365882 100644
--- a/src/assembler.cpp
+++ b/src/assembler.cpp
@@ -186,7 +186,7 @@ int Assembler::checkUndefined()
return PASS;
}
-Number operator"" _N(unsigned long long a)
+Number operator"" _NumOp(unsigned long long a)
{
return static_cast(a);
}
@@ -195,8 +195,8 @@ AnyMap Assembler::runTest(std::string_view name, std::string_view contents)
{
if (!finalPass) {
return {
-
{"A", 0_N}, {"X", 0_N}, {"Y", 0_N}, {"SR", 0_N},
-
{"SP", 0_N}, {"PC", 0_N}, {"cycles", 0_N}, {"ram", mach->getRam()}};
-
{"A", 0_NumOp}, {"X", 0_NumOp}, {"Y", 0_NumOp}, {"SR", 0_NumOp},
-
{"SP", 0_NumOp}, {"PC", 0_NumOp}, {"cycles", 0_NumOp}, {"ram", mach->getRam()}};
}
auto saved = save();
`