aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/env.c2
-rw-r--r--src/serd_internal.h6
-rw-r--r--src/writer.c4
-rw-r--r--wscript9
4 files changed, 15 insertions, 6 deletions
diff --git a/src/env.c b/src/env.c
index 65e867a1..8f0b4632 100644
--- a/src/env.c
+++ b/src/env.c
@@ -247,7 +247,7 @@ serd_env_expand_node(const SerdEnv* env,
const size_t len = prefix.len + suffix.len; // FIXME: UTF-8?
SerdNode ret = { NULL, len, len, 0, SERD_URI };
ret.buf = (uint8_t*)malloc(ret.n_bytes + 1);
- _snprintf((char*)ret.buf, ret.n_bytes + 1,
+ snprintf((char*)ret.buf, ret.n_bytes + 1,
"%s%s", prefix.buf, suffix.buf);
return ret;
}
diff --git a/src/serd_internal.h b/src/serd_internal.h
index ba6b5d98..4a19e126 100644
--- a/src/serd_internal.h
+++ b/src/serd_internal.h
@@ -38,9 +38,9 @@
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
-#ifndef fmax
-static inline float
-fmax(float a, float b)
+#ifndef HAVE_FMAX
+static inline double
+fmax(double a, double b)
{
return (a < b) ? b : a;
}
diff --git a/src/writer.c b/src/writer.c
index 26b06690..0ea4ea06 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -31,7 +31,9 @@ typedef struct {
} WriteContext;
static const WriteContext WRITE_CONTEXT_NULL = {
- SERD_NODE_NULL, SERD_NODE_NULL, SERD_NODE_NULL
+ { 0, 0, 0, 0, SERD_NOTHING },
+ { 0, 0, 0, 0, SERD_NOTHING },
+ { 0, 0, 0, 0, SERD_NOTHING }
};
struct SerdWriterImpl {
diff --git a/wscript b/wscript
index 47834cd7..c0eb0651 100644
--- a/wscript
+++ b/wscript
@@ -67,6 +67,13 @@ def configure(conf):
define_name='HAVE_GCOV',
mandatory=False)
+ # Check for fmax
+ conf.check(function_name='fmax',
+ header_name='math.h',
+ define_name='HAVE_FMAX',
+ lib=['m'],
+ mandatory=False)
+
# Check for posix_memalign
conf.check(function_name='posix_memalign',
header_name='stdlib.h',
@@ -120,7 +127,7 @@ def build(bld):
libflags = [ '-fvisibility=hidden' ]
libs = [ 'm' ]
- defines = [ '' ]
+ defines = []
if sys.platform == 'win32':
libflags = []
if bld.env['MSVC_COMPILER']: