diff '--color=auto' -Naur UASM-c612f83d97a0cb192dfd983676743dabf662ed51~/dbgcv.c UASM-c612f83d97a0cb192dfd983676743dabf662ed51/dbgcv.c --- UASM-c612f83d97a0cb192dfd983676743dabf662ed51~/dbgcv.c 2021-04-02 17:57:14.000000000 +0200 +++ UASM-c612f83d97a0cb192dfd983676743dabf662ed51/dbgcv.c 2021-07-20 14:31:39.634571179 +0200 @@ -17,7 +17,24 @@ #include #include #include +#ifdef _WIN32 #include +#endif +#ifdef __UNIX__ +#include +#include +#include +#endif +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif +#define _MAX_PATH PATH_MAX +#ifndef _getcwd +#define _getcwd getcwd +#endif +#ifndef _pgmptr +#define _pgmptr "uasm" +#endif #include #define SIZE_CV_SEGBUF ( MAX_LINE_LEN * 4 ) @@ -1252,7 +1269,9 @@ #define USEMD5 #ifdef USEMD5 +#ifndef BUFSIZ #define BUFSIZ 1024*4 +#endif #define MD5_LENGTH ( sizeof( uint_32 ) + sizeof( uint_16 ) + 16 + sizeof( uint_16 ) ) static int calc_md5(const char* filename, unsigned char* sum) @@ -1575,12 +1594,20 @@ len = strlen(p) + 1; s = strcpy(s, p) + len; *s++ = '\0'; + #ifdef _WIN32 EnvBlock->reclen = (unsigned short)(s - cv.ps - 2); + #else + EnvBlock->reclen = (unsigned short)(s - (char*)cv.ps - 2); + #endif cv.ps = s; /* length needs to be added for each symbol */ + #ifdef _WIN32 cv.section->length += (s - start); + #else + cv.section->length += (s - (char*)start); + #endif } else {