aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/include
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2019-03-07 15:53:19 +0100
committerRickard Green <[email protected]>2019-03-07 16:01:30 +0100
commita4caaef4df6acbdd7c46962004edc1d47504bbf4 (patch)
tree65b1b44ce3d3be457d9483d0fa0e11c68eaf5740 /lib/erl_interface/include
parentc70a0aaeacd91d525c59f9a376022cb87d18e87a (diff)
downloadotp-a4caaef4df6acbdd7c46962004edc1d47504bbf4.tar.gz
otp-a4caaef4df6acbdd7c46962004edc1d47504bbf4.tar.bz2
otp-a4caaef4df6acbdd7c46962004edc1d47504bbf4.zip
Better erl_interface deprecation warning implementation
Diffstat (limited to 'lib/erl_interface/include')
-rw-r--r--lib/erl_interface/include/ei.h17
-rw-r--r--lib/erl_interface/include/ei_config.h.in3
2 files changed, 11 insertions, 9 deletions
diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h
index 10a6e5bf50..aa2a49098f 100644
--- a/lib/erl_interface/include/ei.h
+++ b/lib/erl_interface/include/ei.h
@@ -47,21 +47,26 @@ typedef LONG_PTR ssize_t; /* Sigh... */
# include <netdb.h>
#endif
-#ifndef EI_INCLUDED_CONFIG_H__
-#include "ei_config.h"
+#ifdef __has_attribute
+#if __has_attribute(deprecated)
+#define EI_HAVE_DEPRECATED_ATTR__ 1
+#else
+#undef EI_HAVE_DEPRECATED_ATTR__
+#endif
#endif
-#if defined(HAVE_DEPRECATED_ATTRIBUTE) && !defined(EI_NO_DEPR_WARN)
-#define EI_HAVE_DEPRECATED_ATTR__ 1
+#ifdef EI_NO_DEPR_WARN
+#undef EI_HAVE_DEPRECATED_ATTR__
+#endif
+
+#ifdef EI_HAVE_DEPRECATED_ATTR__
#define EI_DEPRECATED_ATTR_NAME deprecated
#define EI_DEPRECATED_ATTR __attribute__((EI_DEPRECATED_ATTR_NAME))
#else
-#undef EI_HAVE_DEPRECATED_ATTR__
#define EI_DEPRECATED_ATTR_NAME
#define EI_DEPRECATED_ATTR
#endif
-
/* -------------------------------------------------------------------- */
/* Defines part of API */
/* -------------------------------------------------------------------- */
diff --git a/lib/erl_interface/include/ei_config.h.in b/lib/erl_interface/include/ei_config.h.in
deleted file mode 100644
index dfcf676bed..0000000000
--- a/lib/erl_interface/include/ei_config.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-
-/* Define to 1 if you have the `deprecated' attribute */
-#undef HAVE_DEPRECATED_ATTRIBUTE