* support/regression/fwk/lib/testfwk.c: printn is recursive and thus needs
[fw/sdcc] / support / regression / fwk / lib / testfwk.c
index 8259f53e4d85954e66dc0d2fb2bd16291a9a307f..48d923178d87502ec8480b97ea7d4453c93822e3 100644 (file)
@@ -3,10 +3,20 @@
 #include <testfwk.h>
 #include <stdarg.h>
 
+#ifdef __ds390
+#include <tinibios.h> /* main() must see the ISR declarations */
+#endif
+
+#if defined(PORT_HOST) || defined(SDCC_z80) || defined(SDCC_gbz80)
+#define _REENTRANT
+#else
+#define _REENTRANT reentrant
+#endif
+
 /** Define this if the port's div or mod functions are broken.
     A slow loop based method will be substituded.
 */
-#define BROKEN_DIV_MOD         1
+//#define BROKEN_DIV_MOD               1
 
 void _putchar(char c);
 void _exitEmu(void);
@@ -41,7 +51,7 @@ int __mod(int num, int denom)
 }
 #endif
 
-static void _printn(int n) 
+static void _printn(int n) _REENTRANT
 {
     int rem;