Permalink
Browse files

include: add UV_DEPRECATED() macro

  • Loading branch information...
1 parent 99d3102 commit b62ecda0937d51508f5789b0cba221e2546aa32c @bnoordhuis bnoordhuis committed Nov 26, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 include/uv.h
View
@@ -27,6 +27,9 @@
extern "C" {
#endif
+#define UV_VERSION_MAJOR 0
+#define UV_VERSION_MINOR 9
+
#ifdef _WIN32
/* Windows - set up dll import/export decorators. */
# if defined(BUILDING_UV_SHARED)
@@ -45,10 +48,13 @@ extern "C" {
# define UV_EXTERN /* nothing */
#endif
-
-#define UV_VERSION_MAJOR 0
-#define UV_VERSION_MINOR 9
-
+#if defined(__GNUC__)
+# define UV_DEPRECATED __attribute__((deprecated))
+#elif defined(_WIN32)
@piscisaureus

piscisaureus Nov 27, 2012

Member

This is not platform-dependent, but rather compiler-dependent. Use defined(_MSC_VER)

@bnoordhuis

bnoordhuis Dec 28, 2012

Contributor

This is not platform-dependent, but rather compiler-dependent. Use defined(_MSC_VER)

Doesn't that also apply to the definition of UV_EXTERN?

@piscisaureus

piscisaureus Dec 28, 2012

Member

Doesn't that also apply to the definition of UV_EXTERN?

No, the shared library model is tied to the OS loader so it can't be compiler dependent.

+# define UV_DEPRECATED __declspec(deprecated)
+#else
+# define UV_DEPRECATED
+#endif
#if defined(_MSC_VER) && _MSC_VER < 1600
# include "uv-private/stdint-msvc2008.h"

1 comment on commit b62ecda

Member

piscisaureus commented on b62ecda Nov 27, 2012

lgtm, except for the comment

Please sign in to comment.