From d4c12adff648bc4ebd5038e8186069193b22a693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 14 Feb 2014 23:20:25 +0100 Subject: [PATCH] include: expose libuv version in header files --- Makefile.am | 2 +- Makefile.mingw | 1 + include/uv-version.h | 38 ++++++++++++++++++++++++++++++++++++++ include/uv.h | 1 + src/version.c | 14 -------------- uv.gyp | 1 + 6 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 include/uv-version.h diff --git a/Makefile.am b/Makefile.am index 38b6a240..581c2182 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -I$(top_srcdir)/include \ -I$(top_srcdir)/src -include_HEADERS=include/uv.h include/uv-errno.h +include_HEADERS=include/uv.h include/uv-errno.h include/uv-version.h CLEANFILES = diff --git a/Makefile.mingw b/Makefile.mingw index 28a1e274..bc175b54 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -26,6 +26,7 @@ CFLAGS += -Wall \ INCLUDES = include/stdint-msvc2008.h \ include/tree.h \ include/uv-errno.h \ + include/uv-version.h \ include/uv-win.h \ include/uv.h \ src/queue.h \ diff --git a/include/uv-version.h b/include/uv-version.h new file mode 100644 index 00000000..cd98f984 --- /dev/null +++ b/include/uv-version.h @@ -0,0 +1,38 @@ +/* Copyright Joyent, Inc. and other Node contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef UV_VERSION_H +#define UV_VERSION_H + + /* + * Versions with an even minor version (e.g. 0.6.1 or 1.0.4) are API and ABI + * stable. When the minor version is odd, the API can change between patch + * releases. Make sure you update the -soname directives in configure.ac + * and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but + * not UV_VERSION_PATCH.) + */ + +#define UV_VERSION_MAJOR 0 +#define UV_VERSION_MINOR 11 +#define UV_VERSION_PATCH 20 +#define UV_VERSION_IS_RELEASE 0 + +#endif /* UV_VERSION_H */ diff --git a/include/uv.h b/include/uv.h index 25e272e3..1720130e 100644 --- a/include/uv.h +++ b/include/uv.h @@ -46,6 +46,7 @@ extern "C" { #endif #include "uv-errno.h" +#include "uv-version.h" #include #if defined(_MSC_VER) && _MSC_VER < 1600 diff --git a/src/version.c b/src/version.c index 628bb727..02de6de3 100644 --- a/src/version.c +++ b/src/version.c @@ -21,20 +21,6 @@ #include "uv.h" - /* - * Versions with an even minor version (e.g. 0.6.1 or 1.0.4) are API and ABI - * stable. When the minor version is odd, the API can change between patch - * releases. Make sure you update the -soname directives in config-unix.mk - * and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but - * not UV_VERSION_PATCH.) - */ - -#define UV_VERSION_MAJOR 0 -#define UV_VERSION_MINOR 11 -#define UV_VERSION_PATCH 20 -#define UV_VERSION_IS_RELEASE 0 - - #define UV_VERSION ((UV_VERSION_MAJOR << 16) | \ (UV_VERSION_MINOR << 8) | \ (UV_VERSION_PATCH)) diff --git a/uv.gyp b/uv.gyp index c64d72a7..ec85bbdb 100644 --- a/uv.gyp +++ b/uv.gyp @@ -61,6 +61,7 @@ 'include/uv.h', 'include/tree.h', 'include/uv-errno.h', + 'include/uv-version.h', 'src/fs-poll.c', 'src/inet.c', 'src/queue.h',