summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/backward/rubysig.h8
-rw-r--r--include/ruby/debug.h8
-rw-r--r--include/ruby/defines.h11
-rw-r--r--include/ruby/encoding.h8
-rw-r--r--include/ruby/intern.h8
-rw-r--r--include/ruby/io.h8
-rw-r--r--include/ruby/missing.h13
-rw-r--r--include/ruby/oniguruma.h8
-rw-r--r--include/ruby/re.h8
-rw-r--r--include/ruby/regex.h8
-rw-r--r--include/ruby/ruby.h8
-rw-r--r--include/ruby/st.h8
-rw-r--r--include/ruby/thread.h8
-rw-r--r--include/ruby/util.h8
-rw-r--r--include/ruby/version.h8
-rw-r--r--include/ruby/vm.h8
-rw-r--r--include/ruby/win32.h8
17 files changed, 43 insertions, 101 deletions
diff --git a/include/ruby/backward/rubysig.h b/include/ruby/backward/rubysig.h
index f46679ae67..945a09a8c8 100644
--- a/include/ruby/backward/rubysig.h
+++ b/include/ruby/backward/rubysig.h
@@ -27,9 +27,7 @@ extern "C" {
#endif
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
struct rb_blocking_region_buffer;
DEPRECATED(RUBY_EXTERN struct rb_blocking_region_buffer *rb_thread_blocking_region_begin(void));
@@ -42,9 +40,7 @@ DEPRECATED(RUBY_EXTERN void rb_thread_blocking_region_end(struct rb_blocking_reg
#define ALLOW_INTS do {CHECK_INTS;} while (0)
#define CHECK_INTS rb_thread_check_ints()
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/debug.h b/include/ruby/debug.h
index 4ef45a8327..67e15a8d2f 100644
--- a/include/ruby/debug.h
+++ b/include/ruby/debug.h
@@ -19,9 +19,7 @@ extern "C" {
#endif
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
/* Note: This file contains experimental APIs. */
/* APIs can be replaced at Ruby 2.0.1 or later */
@@ -79,9 +77,7 @@ typedef enum {
void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index c741b0ec28..99305b2c4b 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -88,10 +88,13 @@ extern "C" {
#define ANYARGS
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
+#ifndef RUBY_SYMBOL_EXPORT_BEGIN
+# define RUBY_SYMBOL_EXPORT_BEGIN /* begin */
+# define RUBY_SYMBOL_EXPORT_END /* end */
#endif
+RUBY_SYMBOL_EXPORT_BEGIN
+
#define xmalloc ruby_xmalloc
#define xmalloc2 ruby_xmalloc2
#define xcalloc ruby_xcalloc
@@ -281,9 +284,7 @@ void rb_ia64_flushrs(void);
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index 41640ec7e0..1233053063 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -22,9 +22,7 @@ extern "C" {
#include <stdarg.h>
#include "ruby/oniguruma.h"
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
#define ENCODING_INLINE_MAX 1023
#define ENCODING_SHIFT (FL_USHIFT+10)
@@ -340,9 +338,7 @@ void rb_econv_binmode(rb_econv_t *ec);
#define ECONV_AFTER_OUTPUT 0x00020000
/* end of flags for rb_econv_convert */
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index de430a9eaf..7377718222 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -34,9 +34,7 @@ extern "C" {
#include "ruby/st.h"
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
/*
* Functions and variables that are used by more than one source file of
@@ -909,9 +907,7 @@ int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
VALUE rb_make_backtrace(void);
VALUE rb_make_exception(int, VALUE*);
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/io.h b/include/ruby/io.h
index b5ea2e9c95..bcdee3b0c0 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -49,9 +49,7 @@ extern "C" {
# define RB_WAITFD_OUT 0x004
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
typedef struct {
char *ptr; /* off + len <= capa */
@@ -199,9 +197,7 @@ void rb_io_read_check(rb_io_t*);
int rb_io_read_pending(rb_io_t*);
DEPRECATED(void rb_read_check(FILE*));
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/missing.h b/include/ruby/missing.h
index 9b502cd3d8..5dba4edda7 100644
--- a/include/ruby/missing.h
+++ b/include/ruby/missing.h
@@ -34,6 +34,11 @@ extern "C" {
#endif
#endif
+#ifndef RUBY_SYMBOL_EXPORT_BEGIN
+# define RUBY_SYMBOL_EXPORT_BEGIN /* begin */
+# define RUBY_SYMBOL_EXPORT_END /* end */
+#endif
+
#if !defined(HAVE_STRUCT_TIMEVAL)
struct timeval {
time_t tv_sec; /* seconds */
@@ -62,9 +67,7 @@ struct timezone {
#define RUBY_EXTERN extern
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
#ifndef HAVE_ACOSH
RUBY_EXTERN double acosh(double);
@@ -229,9 +232,7 @@ RUBY_EXTERN int ruby_close(int);
RUBY_EXTERN void setproctitle(const char *fmt, ...);
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h
index e3763adc59..b96773e11e 100644
--- a/include/ruby/oniguruma.h
+++ b/include/ruby/oniguruma.h
@@ -98,9 +98,7 @@ extern "C" {
#define ONIG_EXTERN extern
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
#include <stddef.h> /* for size_t */
@@ -825,9 +823,7 @@ const char* onig_version P_((void));
ONIG_EXTERN
const char* onig_copyright P_((void));
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#ifdef __cplusplus
#if 0
diff --git a/include/ruby/re.h b/include/ruby/re.h
index 4039ba1800..41b3e492f8 100644
--- a/include/ruby/re.h
+++ b/include/ruby/re.h
@@ -24,9 +24,7 @@ extern "C" {
#include "ruby/regex.h"
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
typedef struct re_pattern_buffer Regexp;
@@ -61,9 +59,7 @@ void rb_match_busy(VALUE);
VALUE rb_reg_quote(VALUE);
regex_t *rb_reg_prepare_re(VALUE re, VALUE str);
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/regex.h b/include/ruby/regex.h
index aeb6418d0a..024bed4a4e 100644
--- a/include/ruby/regex.h
+++ b/include/ruby/regex.h
@@ -24,9 +24,7 @@ extern "C" {
#include "oniguruma.h"
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
#ifndef ONIG_RUBY_M17N
@@ -36,9 +34,7 @@ ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding;
#endif /* ifndef ONIG_RUBY_M17N */
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 3822942d07..5bd71121f6 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -55,9 +55,7 @@ extern "C" {
#include <stdarg.h>
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
/* Make alloca work the best possible way. */
#ifdef __GNUC__
@@ -1708,9 +1706,7 @@ void ruby_sig_finalize(void);
/*! @} */
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/st.h b/include/ruby/st.h
index 466bbcf5f6..ef838b7aeb 100644
--- a/include/ruby/st.h
+++ b/include/ruby/st.h
@@ -14,9 +14,7 @@ extern "C" {
#include "ruby/defines.h"
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
#if SIZEOF_LONG == SIZEOF_VOIDP
typedef unsigned long st_data_t;
@@ -130,9 +128,7 @@ st_index_t st_hash_end(st_index_t h);
st_index_t st_hash_start(st_index_t h);
#define st_hash_start(h) ((st_index_t)(h))
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/thread.h b/include/ruby/thread.h
index fb9057c70f..550f678e54 100644
--- a/include/ruby/thread.h
+++ b/include/ruby/thread.h
@@ -21,9 +21,7 @@ extern "C" {
#include "ruby/intern.h"
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
@@ -35,9 +33,7 @@ void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/util.h b/include/ruby/util.h
index 02aa643916..5be5f2e0b4 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -45,9 +45,7 @@ extern "C" {
#endif
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
#define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
unsigned long ruby_scan_oct(const char *, size_t, size_t *);
@@ -85,9 +83,7 @@ double ruby_strtod(const char *, char **);
void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/version.h b/include/ruby/version.h
index 9ecf6fe2a5..4ffcc7a9ad 100644
--- a/include/ruby/version.h
+++ b/include/ruby/version.h
@@ -43,9 +43,7 @@ extern "C" {
#endif
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
/*
* Interfaces from extension libraries.
@@ -63,9 +61,7 @@ RUBY_EXTERN const char ruby_description[];
RUBY_EXTERN const char ruby_copyright[];
RUBY_EXTERN const char ruby_engine[];
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/vm.h b/include/ruby/vm.h
index 1146bf5426..73345264bd 100644
--- a/include/ruby/vm.h
+++ b/include/ruby/vm.h
@@ -19,9 +19,7 @@ extern "C" {
#endif
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
/* Place holder.
*
@@ -54,9 +52,7 @@ int ruby_vm_destruct(ruby_vm_t *vm);
*/
void ruby_vm_at_exit(void(*func)(ruby_vm_t *));
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
#if 0
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index a2eec0cf19..56fa3e5c0c 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -8,9 +8,7 @@ extern "C" {
#endif
#endif
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility push(default)
-#endif
+RUBY_SYMBOL_EXPORT_BEGIN
/*
* Copyright (c) 1993, Intergraph Corporation
@@ -735,9 +733,7 @@ in asynchronous_func_t.
typedef uintptr_t (*asynchronous_func_t)(uintptr_t self, int argc, uintptr_t* argv);
uintptr_t rb_w32_asynchronize(asynchronous_func_t func, uintptr_t self, int argc, uintptr_t* argv, uintptr_t intrval);
-#if defined __GNUC__ && __GNUC__ >= 4
-#pragma GCC visibility pop
-#endif
+RUBY_SYMBOL_EXPORT_END
#ifdef __MINGW_ATTRIB_PURE
/* License: Ruby's */