Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alexmarsev/soxr.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Sykes <rob@rob-Ideapad-S205.(none)>2013-02-28 00:48:20 +0400
committerRob Sykes <rob@rob-Ideapad-S205.(none)>2013-02-28 01:19:41 +0400
commitc5adbf7079a9cfc24e7ef2a3d1aeaab16d1fb44e (patch)
treecfe2798b72e03299a6414be380a90ea51f1bf9b3
parentb5ba8db22a34f70466e0dfe87e120215fb700cc8 (diff)
Add API version check macros
-rw-r--r--msvc/soxr-config.h1
-rw-r--r--soxr-config.h.in1
-rw-r--r--src/soxr.c2
-rw-r--r--src/soxr.h15
4 files changed, 13 insertions, 6 deletions
diff --git a/msvc/soxr-config.h b/msvc/soxr-config.h
index a1d507e..a158de4 100644
--- a/msvc/soxr-config.h
+++ b/msvc/soxr-config.h
@@ -7,7 +7,6 @@
#if !defined soxr_config_included
#define soxr_config_included
-#define SOXR_VERSION "0.1.0"
#define HAVE_SINGLE_PRECISION 1
#define HAVE_DOUBLE_PRECISION 1
#define HAVE_AVFFT 0
diff --git a/soxr-config.h.in b/soxr-config.h.in
index 21e6522..227bcfd 100644
--- a/soxr-config.h.in
+++ b/soxr-config.h.in
@@ -4,7 +4,6 @@
#if !defined soxr_config_included
#define soxr_config_included
-#define SOXR_VERSION "@PROJECT_VERSION@"
#define HAVE_SINGLE_PRECISION @HAVE_SINGLE_PRECISION@
#define HAVE_DOUBLE_PRECISION @HAVE_DOUBLE_PRECISION@
#define HAVE_AVFFT @HAVE_AVFFT@
diff --git a/src/soxr.c b/src/soxr.c
index 8a9eca6..93dd9c1 100644
--- a/src/soxr.c
+++ b/src/soxr.c
@@ -14,7 +14,7 @@
char const * soxr_version(void)
{
- return "libsoxr-" SOXR_VERSION;
+ return "libsoxr-" SOXR_THIS_VERSION_STR;
}
diff --git a/src/soxr.h b/src/soxr.h
index aa7960d..1c0158f 100644
--- a/src/soxr.h
+++ b/src/soxr.h
@@ -60,10 +60,19 @@ input or output (e.g. ilen, olen). */
+/* --------------------------- Version management --------------------------- */
+
+/* E.g. #if SOXR_THIS_VERSION >= SOXR_VERSION(0,1,1) ... */
+#define SOXR_VERSION(x,y,z) (((x)<<16)|((y)<<8)|(z))
+#define SOXR_THIS_VERSION SOXR_VERSION(0,1,0)
+#define SOXR_THIS_VERSION_STR "0.1.0"
+
+
+
/* --------------------------- Type declarations ---------------------------- */
-typedef struct soxr * soxr_t; /* A resampler for 1 or more channels. */
-typedef char const * soxr_error_t; /* 0:no-error; non-0:error. */
+typedef struct soxr * soxr_t; /* A resampler for 1 or more channels. */
+typedef char const * soxr_error_t; /* 0:no-error; non-0:error. */
typedef void * soxr_buf_t; /* 1 buffer of channel-interleaved samples. */
typedef void const * soxr_cbuf_t; /* Ditto; read-only. */
@@ -80,7 +89,7 @@ typedef void * soxr_out_t; /* Either a soxr_buf_t or soxr_bufs_t,
/* --------------------------- API main functions --------------------------- */
-SOXR char const * soxr_version(void); /* Query library version: "x.y.z". */
+SOXR char const * soxr_version(void); /* Query library version: "libsoxr-x.y.z" */
#define soxr_strerror(e) /* Soxr counterpart to strerror. */ \
((e)?(e):"no error")