summaryrefslogtreecommitdiff
path: root/graphics/fotoxx/patches/patch-ab
blob: f2280917fdf65a53b307c2c0e74951cc06411881 (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
$NetBSD: patch-ab,v 1.8 2012/08/12 07:20:15 ryoon Exp $

--- zfuncs.cc.orig	2012-08-04 11:58:30.000000000 +0000
+++ zfuncs.cc
@@ -81,6 +81,7 @@ void zappcrash(cchar *pMess, ... )
 
    printf("*** zappcrash: \n %s \n",message);                              //  output message to stdout
 
+#if defined (__linux__) || (defined (__NetBSD__) && (__NetBSD_Version__ >= 699000000))
    nstack = backtrace(stacklist,nstack);                                   //  get traceback data
    stackents = backtrace_symbols(stacklist,nstack);
 
@@ -90,6 +91,7 @@ void zappcrash(cchar *pMess, ... )
    fid1 = fopen("zappcrash","w");                                          //  text file for backtrace
 
    fprintf(fid1,"zappcrash: \n %s \n",message);                            //  output message to text file
+#endif
    
    cc = readlink("/proc/self/exe",progexe,300);                            //  get own program path
    if (cc <= 0) {
@@ -98,6 +100,7 @@ void zappcrash(cchar *pMess, ... )
    }
    progexe[cc] = 0;
 
+#if defined (__linux__) || (defined (__NetBSD__) && (__NetBSD_Version__ >= 699000000))
    for (ii = 0; ii < nstack; ii++)                                         //  output backtrace to text file
    {
       pfunc = 0;
@@ -117,6 +120,7 @@ void zappcrash(cchar *pMess, ... )
 
       fprintf(fid1," %s %s \n",stackents[ii],pfunc);                       //  write to text file
    }
+#endif
 
    fclose(fid1);