summaryrefslogtreecommitdiff
path: root/dev-lang/uasm/files/dbgcv.patch
blob: c523cd65e9e2d857bd8a4fde7367c024cf24eb61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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 <fixup.h>
 #include <dbgcv.h>
 #include <linnum.h>
+#ifdef _WIN32
 #include <direct.h>
+#endif
+#ifdef __UNIX__
+#include <stdio.h>
+#include <unistd.h>
+#include <limits.h>
+#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 <picohash.h>
 
 #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 {