File: 107-define-strdup-macro-safely.dpatch

package info (click to toggle)
cernlib 20061220%2Bdfsg3-4.4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,872 kB
  • sloc: sh: 9,517; makefile: 187
file content (32 lines) | stat: -rwxr-xr-x 1,319 bytes parent folder | download | duplicates (4)
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
#! /bin/sh /usr/share/dpatch/dpatch-run
## 107-define-strdup-macro-safely.dpatch by  <kmccarty@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: In some cases strdup() and strndup() are macros, causing a build
## DP: failure.  Ensure any such macros are undefined before redeclaring them.

@DPATCH@
diff -urNad cernlib-2005.05.09/src/packlib/kuip/kuip/kstring.h /tmp/dpep.ieQnkg/cernlib-2005.05.09/src/packlib/kuip/kuip/kstring.h
--- cernlib-2005.05.09~/src/packlib/kuip/kuip/kstring.h	1997-03-14 12:16:39.000000000 -0500
+++ cernlib-2005.05.09/src/packlib/kuip/kuip/kstring.h	2005-06-09 14:58:22.446739916 -0400
@@ -32,6 +32,9 @@
 
 extern char* strrstr( const char* str1, const char* str2 );
 
+#ifdef strdup
+# undef strdup /* otherwise the next function declaration may bomb */
+#endif
 #define strdup Strdup           /* prototype without const */
 extern char* strdup( const char* str );
 
@@ -46,6 +49,10 @@
                      const char* str4 );
 extern char* str5dup( const char* str1, const char* str2, const char* str3,
                      const char* str4, const char* str5 );
+
+#ifdef strndup
+# undef strndup /* otherwise the next function declaration may bomb */
+#endif
 extern char* strndup( const char* buf, size_t n );
 extern char* stridup( int i );