Browse code

corrections for non-gnu platforms

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/seqbias@52194 bc3139a8-67e5-0310-9ffc-ced21a209358

Daniel Jones authored on 30/01/2011 06:54:19
Showing 5 changed files

... ...
@@ -118,7 +118,7 @@ configure:2948: result: yes
118 118
 configure:2948: checking for pow
119 119
 configure:2948: gcc -o conftest -g -O2   conftest.c -lz  >&5
120 120
 conftest.c:35: warning: conflicting types for built-in function 'pow'
121
-/tmp/ccxSNas5.o: In function `main':
121
+/tmp/cc2oJinr.o: In function `main':
122 122
 /home/dcjones/bio/seqbias/conftest.c:46: undefined reference to `pow'
123 123
 collect2: ld returned 1 exit status
124 124
 configure:2948: $? = 1
... ...
@@ -176,7 +176,7 @@ configure:2948: result: no
176 176
 configure:2948: checking for sqrt
177 177
 configure:2948: gcc -o conftest -g -O2   conftest.c -lz  >&5
178 178
 conftest.c:35: warning: conflicting types for built-in function 'sqrt'
179
-/tmp/ccFZLqEa.o: In function `main':
179
+/tmp/ccFdFAsw.o: In function `main':
180 180
 /home/dcjones/bio/seqbias/conftest.c:46: undefined reference to `sqrt'
181 181
 collect2: ld returned 1 exit status
182 182
 configure:2948: $? = 1
... ...
@@ -3,6 +3,7 @@
3 3
 #include "common.hpp"
4 4
 #include "miscmath.hpp"
5 5
 #include "logger.h"
6
+#include "snprintf.h"
6 7
 
7 8
 #include <string>
8 9
 #include <cstring>
... ...
@@ -1,6 +1,6 @@
1 1
 
2
-
3 2
 #include "logger.h"
3
+#include "snprintf.h"
4 4
 
5 5
 #include <R.h>
6 6
 #include <R_ext/Print.h>
... ...
@@ -11,6 +11,7 @@
11 11
 #include <stdarg.h>
12 12
 #include <stdbool.h>
13 13
 
14
+
14 15
 const char* INDENT = "  ";
15 16
 
16 17
 struct logger
... ...
@@ -6,6 +6,7 @@ extern "C" {
6 6
 #include "samtools/faidx.h"
7 7
 #include "samtools/faidx_t.h"
8 8
 #include "samtools/sam.h"
9
+#include "snprintf.h"
9 10
 
10 11
 #include <R.h>
11 12
 #include <Rinternals.h>
... ...
@@ -4,23 +4,23 @@
4 4
 #define PORTABLE_SNPRINTF_VERSION_MAJOR 2
5 5
 #define PORTABLE_SNPRINTF_VERSION_MINOR 2
6 6
 
7
-#ifdef HAVE_SNPRINTF
8
-#include <stdio.h>
9
-#else
10
-extern int snprintf(char *, size_t, const char *, /*args*/ ...);
11
-extern int vsnprintf(char *, size_t, const char *, va_list);
7
+#ifdef __cplusplus
8
+extern "C" {
12 9
 #endif
13 10
 
14
-#if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF)
15
-extern int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);
16
-extern int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap);
17
-#define snprintf  portable_snprintf
18
-#define vsnprintf portable_vsnprintf
19
-#endif
11
+#include <stdarg.h>
12
+#include <stdio.h>
20 13
 
14
+#ifndef _GNU_SOURCE 
21 15
 extern int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
22 16
 extern int vasprintf (char **ptr, const char *fmt, va_list ap);
23 17
 extern int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
24 18
 extern int vasnprintf(char **ptr, size_t str_m, const char *fmt, va_list ap);
19
+#endif
20
+
21
+
22
+#ifdef __cplusplus
23
+}
24
+#endif
25 25
 
26 26
 #endif