diff --git a/.gitignore b/.gitignore index db44e75..3b4bffe 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,4 @@ missing stamp-h1 *.pyc *.pc -/src/jansson.h +/src/jansson_config.h diff --git a/configure.ac b/configure.ac index 4a199e4..0b7e79d 100644 --- a/configure.ac +++ b/configure.ac @@ -33,7 +33,7 @@ AC_CONFIG_FILES([ Makefile doc/Makefile src/Makefile - src/jansson.h + src/jansson_config.h test/Makefile test/bin/Makefile test/suites/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index cb9180e..c7a3927 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -include_HEADERS = jansson.h +include_HEADERS = jansson.h jansson_config.h lib_LTLIBRARIES = libjansson.la libjansson_la_SOURCES = \ diff --git a/src/jansson.h.in b/src/jansson.h similarity index 98% rename from src/jansson.h.in rename to src/jansson.h index 975edd6..81235ff 100644 --- a/src/jansson.h.in +++ b/src/jansson.h @@ -10,11 +10,9 @@ #include #include /* for size_t */ +#include -#ifndef __cplusplus -#define JSON_INLINE @json_inline@ -#else -#define JSON_INLINE inline +#ifdef __cplusplus extern "C" { #endif diff --git a/src/jansson_config.h.in b/src/jansson_config.h.in new file mode 100644 index 0000000..1a9d859 --- /dev/null +++ b/src/jansson_config.h.in @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2010 Petri Lehtinen + * + * Jansson is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef JANSSON_CONFIG_H +#define JANSSON_CONFIG_H + +#ifdef __cplusplus +#define JSON_INLINE inline +#else +#define JSON_INLINE @json_inline@ +#endif + +#endif