stardot / beebasm

A portable 6502 assembler with BBC Micro style syntax
http://www.retrosoftware.co.uk/wiki/index.php/BeebAsm
GNU General Public License v3.0
84 stars 26 forks source link

Compilation failures on RedHat 7 and gcc version 4.8.5 #90

Closed sweharris closed 1 year ago

sweharris commented 1 year ago

In value.h it complains about free() and malloc() not being defined. It needs <cstdlib> to be included to define these.

Similarly literals.cpp complains about strtod.

I think these changes should be compatible with all platforms, but I'm not sure

diff --git a/src/literals.cpp b/src/literals.cpp
index 1aae858..113a676 100644
--- a/src/literals.cpp
+++ b/src/literals.cpp
@@ -21,6 +21,7 @@
 /*************************************************************************************************/

 #include <cassert>
+#include <cstdlib>

 #include "asmexception.h"
 #include "literals.h"
diff --git a/src/value.h b/src/value.h
index ff853e2..ce3e1fa 100644
--- a/src/value.h
+++ b/src/value.h
@@ -25,6 +25,7 @@

 #include <cassert>
 #include <string.h>
+#include <cstdlib>

 // A simple immutable string buffer with a length and a reference count.
mungre commented 1 year ago

Thank you. I put your fix in branch issue-90b. It works in Visual Studio 2010 and it passes the tests on github using up-to-date compilers. So I think it's good. If you're happy with it I'll do a pr and merge it.

sweharris commented 1 year ago

Looks good to me! Thanks.