summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/internal.h b/internal.h
index c39fa18174..002044cfa1 100644
--- a/internal.h
+++ b/internal.h
@@ -1,7 +1,6 @@
#ifndef RUBY_INTERNAL_H /*-*-C-*-vi:se ft=c:*/
#define RUBY_INTERNAL_H 1
/**
- * @file
* @author $Author$
* @date Tue May 17 11:42:20 JST 2011
* @copyright Copyright (C) 2011 Yukihiro Matsumoto
@@ -10,7 +9,7 @@
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
-#include "ruby/3/config.h"
+#include "ruby/internal/config.h"
#ifdef __cplusplus
# error not for C++
@@ -26,23 +25,26 @@
/* Prevent compiler from reordering access */
#define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))
+#define UNDEF_P RB_UNDEF_P
+#define NIL_OR_UNDEF_P RB_NIL_OR_UNDEF_P
+
#include "ruby/ruby.h"
/* Following macros were formerly defined in this header but moved to somewhere
* else. In order to detect them we undef here. */
+/* internal/array.h */
+#undef RARRAY_AREF
+
/* internal/class.h */
#undef RClass
#undef RCLASS_SUPER
-/* internal/gc.h */
-#undef NEWOBJ_OF
-#undef RB_NEWOBJ_OF
-#undef RB_OBJ_WRITE
-
/* internal/hash.h */
#undef RHASH_IFNONE
#undef RHASH_SIZE
+#undef RHASH_TBL
+#undef RHASH_EMPTY_P
/* internal/struct.h */
#undef RSTRUCT_LEN
@@ -56,9 +58,6 @@
/* internal/array.h */
#define rb_ary_new_from_args(...) rb_nonexistent_symbol(__VA_ARGS__)
-/* internal/io.h */
-#define rb_io_fptr_finalize(...) rb_nonexistent_symbol(__VA_ARGS__)
-
/* internal/string.h */
#define rb_fstring_cstr(...) rb_nonexistent_symbol(__VA_ARGS__)
@@ -77,20 +76,30 @@ void rb_obj_info_dump(VALUE obj);
void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func);
/* debug.c */
+
+RUBY_SYMBOL_EXPORT_BEGIN
void ruby_debug_breakpoint(void);
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
+RUBY_SYMBOL_EXPORT_END
// show obj data structure without any side-effect
#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
// same as rp, but add message header
#define rp_m(msg, obj) do { \
- fprintf(stderr, "%s", (msg)); \
- rb_obj_info_dump((VALUE)obj); \
+ fputs((msg), stderr); \
+ rb_obj_info_dump((VALUE)(obj)); \
} while (0)
// `ruby_debug_breakpoint()` does nothing,
// but breakpoint is set in run.gdb, so `make gdb` can stop here.
#define bp() ruby_debug_breakpoint()
+#define RBOOL(v) ((v) ? Qtrue : Qfalse)
+#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
+
+#ifndef __MINGW32__
+#undef memcpy
+#define memcpy ruby_nonempty_memcpy
+#endif
#endif /* RUBY_INTERNAL_H */