blob: a87451362aba8e6a15d79d6932f9c2ec453eade1 (
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
|
$NetBSD: patch-an,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
--- Top/one_file.c.orig 2006-01-11 03:47:55.000000000 -0800
+++ Top/one_file.c
@@ -24,7 +24,7 @@
#include "csoundCore.h"
#include <ctype.h>
#include <errno.h>
-#if defined(LINUX) || defined(__MACH__) || defined(WIN32)
+#if defined(LINUX) || defined(__MACH__) || defined(WIN32) || defined(__NetBSD__)
# include <sys/types.h>
# include <sys/stat.h>
#endif
@@ -66,7 +66,7 @@ CS_NOINLINE char *csoundTmpFileName(CSOU
buf = csound->Malloc(csound, nBytes);
}
{
-#if defined(LINUX) || defined(__MACH__)
+#if defined(LINUX) || defined(__MACH__) || defined(__NetBSD__)
struct stat tmp;
do {
#elif defined(WIN32)
@@ -89,7 +89,7 @@ CS_NOINLINE char *csoundTmpFileName(CSOU
}
#endif
if (ext != NULL && ext[0] != (char) 0) {
-#if !defined(LINUX) && !defined(__MACH__) && !defined(WIN32)
+#if !defined(LINUX) && !defined(__MACH__) && !defined(WIN32) && !defined(__NetBSD__)
char *p;
/* remove original extension (does not work on OS X */
/* and may be a bad idea) */
@@ -109,7 +109,7 @@ CS_NOINLINE char *csoundTmpFileName(CSOU
} while (buf[i] != (char) 0);
}
#endif
-#if defined(LINUX) || defined(__MACH__)
+#if defined(LINUX) || defined(__MACH__) || defined(__NetBSD__)
/* if the file already exists, try again */
} while (stat(buf, &tmp) == 0);
#elif defined(WIN32)
|