# HG changeset patch # User William Astle # Date 1432684260 21600 # Node ID ade217fd76a51519fb968f00ad87d0a5e0f9eb3c # Parent f318407d246938128c46b414fdbe2f591ce31e49 Use #define instead of const int to avoid issues with some compilers It's not strictly kosher in older C specs to use a "const int" to define an array. For improved portability, switch several "const int" constants to "#define" constants to avoid such problems. Thanks to Erik G for pointing this out. diff -r f318407d2469 -r ade217fd76a5 lwasm/output.c --- a/lwasm/output.c Tue May 26 17:49:26 2015 -0600 +++ b/lwasm/output.c Tue May 26 17:51:00 2015 -0600 @@ -23,7 +23,10 @@ #include #include #include -#include + +#ifndef _MSC_VER +#include // for unlink +#endif #include #include @@ -303,16 +306,16 @@ void write_code_srec(asmstate_t *as, FILE *of) { - const int SRECLEN = 16; - const int HDRLEN = 51; + #define SRECLEN 16 + #define HDRLEN 51 line_t *cl; char outbyte; int outaddr; int rc; - int i; + unsigned int i; int recaddr = 0; - int recdlen = 0; + unsigned int recdlen = 0; unsigned char recdata[SRECLEN]; int recsum; int reccnt = -1; @@ -415,7 +418,7 @@ void write_code_ihex(asmstate_t *as, FILE *of) { - const int IRECLEN = 16; + #define IRECLEN 16 line_t *cl; char outbyte;