File: issue176.patch

package info (click to toggle)
0ad 0.0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 51,248 kB
  • ctags: 46,933
  • sloc: cpp: 223,208; ansic: 31,240; python: 16,343; perl: 4,083; sh: 1,011; makefile: 915; xml: 733; java: 621; ruby: 229; erlang: 53; sql: 40
file content (105 lines) | stat: -rw-r--r-- 3,041 bytes parent folder | download | duplicates (6)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Index: src/src/nvcore/nvcore.h
===================================================================
--- src/src/nvcore/nvcore.h	(revision 11943)
+++ src/src/nvcore/nvcore.h	(working copy)
@@ -41,6 +41,9 @@
 #elif defined POSH_OS_FREEBSD
 #	define NV_OS_FREEBSD 1
 #	define NV_OS_UNIX 1
+#elif defined POSH_OS_OPENBSD
+#	define NV_OS_OPENBSD 1
+#	define NV_OS_UNIX 1
 #elif defined POSH_OS_CYGWIN32
 #	define NV_OS_CYGWIN 1
 #elif defined POSH_OS_MINGW
@@ -178,7 +181,7 @@
 #elif NV_CC_GNUC
 #	if NV_OS_LINUX
 #		include "DefsGnucLinux.h"
-#	elif NV_OS_DARWIN || NV_OS_FREEBSD
+#	elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
 #		include "DefsGnucDarwin.h"
 #	elif NV_OS_MINGW
 #		include "DefsGnucWin32.h"
Index: src/src/nvcore/Debug.cpp
===================================================================
--- src/src/nvcore/Debug.cpp	(revision 11943)
+++ src/src/nvcore/Debug.cpp	(working copy)
@@ -27,7 +27,7 @@
 #	include <signal.h>
 #endif
 
-#if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD
+#if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
 #	include <unistd.h>	// getpid
 #endif
 
@@ -38,10 +38,13 @@
 #	endif
 #endif
 
-#if NV_OS_DARWIN || NV_OS_FREEBSD
+#if NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
 #	include <sys/types.h>
+#	include <sys/param.h>
 #	include <sys/sysctl.h>	// sysctl
-#	include <sys/ucontext.h>
+#	if !NV_OS_OPENBSD
+#		include <sys/ucontext.h>
+#	endif
 #	undef HAVE_EXECINFO_H
 #	if defined(HAVE_EXECINFO_H) // only after OSX 10.5
 #		include <execinfo.h> // backtrace
@@ -210,6 +213,14 @@
 			ucontext_t * ucp = (ucontext_t *)secret;
 			return (void *)ucp->uc_mcontext.mc_eip;
 #		endif
+#	elif NV_OS_OPENBSD
+#		if NV_CPU_X86_64
+			ucontext_t * ucp = (ucontext_t *)secret;
+			return (void *)ucp->sc_rip;
+#		elif NV_CPU_X86
+			ucontext_t * ucp = (ucontext_t *)secret;
+			return (void *)ucp->sc_eip;
+#		endif
 #	else
 #		if NV_CPU_X86_64
 			// #define REG_RIP REG_INDEX(rip) // seems to be 16
Index: src/src/nvcore/poshlib/posh.h
===================================================================
--- src/src/nvcore/poshlib/posh.h	(revision 11943)
+++ src/src/nvcore/poshlib/posh.h	(working copy)
@@ -298,6 +298,11 @@
 #  define POSH_OS_STRING "FreeBSD"
 #endif
 
+#if defined __OpenBSD__
+#  define POSH_OS_OPENBSD 1
+#  define POSH_OS_STRING "OpenBSD"
+#endif
+
 #if defined __CYGWIN32__
 #  define POSH_OS_CYGWIN32 1
 #  define POSH_OS_STRING "Cygwin"
Index: src/src/nvmath/nvmath.h
===================================================================
--- src/src/nvmath/nvmath.h	(revision 11943)
+++ src/src/nvmath/nvmath.h	(working copy)
@@ -115,7 +115,7 @@
 {
 #if NV_OS_WIN32
 	return _finite(f) != 0;
-#elif NV_OS_DARWIN || NV_OS_FREEBSD
+#elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
 	return isfinite(f);
 #elif NV_OS_LINUX
 	return finitef(f);
@@ -130,7 +130,7 @@
 {
 #if NV_OS_WIN32
 	return _isnan(f) != 0;
-#elif NV_OS_DARWIN || NV_OS_FREEBSD
+#elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
 	return isnan(f);
 #elif NV_OS_LINUX
 	return isnanf(f);