Ruby: include/ruby/defines.h Source File

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

defines.h
Go to the documentation of this file.
1#ifndef RUBY_DEFINES_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RUBY_DEFINES_H 1
13#include "ruby/internal/config.h"
14
15/* AC_INCLUDES_DEFAULT */
16#include <stdio.h>
17
18#ifdef HAVE_SYS_TYPES_H
19# include <sys/types.h>
20#endif
21
22#ifdef HAVE_SYS_STAT_H
23# include <sys/stat.h>
24#endif
25
26#ifdef STDC_HEADERS
27# include <stdlib.h>
28# include <stddef.h>
29#else
30# ifdef HAVE_STDLIB_H
31# include <stdlib.h>
32# endif
33#endif
34
35#ifdef HAVE_STRING_H
36# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
37# include <memory.h>
38# endif
39# include <string.h>
40#endif
41
42#ifdef HAVE_STRINGS_H
43# include <strings.h>
44#endif
45
46#ifdef HAVE_INTTYPES_H
47# include <inttypes.h>
48#endif
49
50#ifdef HAVE_STDINT_H
51# include <stdint.h>
52#endif
53
54#ifdef HAVE_STDALIGN_H
55# include <stdalign.h>
56#endif
57
58#ifdef HAVE_UNISTD_H
59# include <unistd.h>
60#endif
61
62#ifdef HAVE_SYS_SELECT_H
63# include <sys/select.h>
64#endif
65
66#ifdef RUBY_USE_SETJMPEX
67# include <setjmpex.h>
68#endif
69
70#include "ruby/internal/dllexport.h"
71#include "ruby/internal/xmalloc.h"
72#include "ruby/backward/2/assume.h"
73#include "ruby/backward/2/attributes.h"
74#include "ruby/backward/2/bool.h"
75#include "ruby/backward/2/long_long.h"
76#include "ruby/backward/2/stdalign.h"
77#include "ruby/backward/2/stdarg.h"
78#include "ruby/internal/dosish.h"
79#include "ruby/missing.h"
80
85#define RUBY
86
87#ifdef __GNUC__
88#
89# define RB_GNUC_EXTENSION __extension__
90#
91# define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
92#else
93# define RB_GNUC_EXTENSION
94# define RB_GNUC_EXTENSION_BLOCK(x) (x)
95#endif
96
99/* :FIXME: Can someone tell us why is this macro defined here? @shyouhei
100 * thinks this is a truly internal macro but cannot move around because he
101 * doesn't understand the reason of this arrangement. */
102#ifndef RUBY_MBCHAR_MAXSIZE
103# define RUBY_MBCHAR_MAXSIZE INT_MAX
104# /* MB_CUR_MAX will not work well in C locale */
105#endif
106
107#if defined(__sparc)
108 RBIMPL_SYMBOL_EXPORT_BEGIN()
109void rb_sparc_flush_register_windows(void);
110 RBIMPL_SYMBOL_EXPORT_END()
111# define FLUSH_REGISTER_WINDOWS rb_sparc_flush_register_windows()
112#else
113# define FLUSH_REGISTER_WINDOWS ((void)0)
114#endif
116#endif /* RUBY_DEFINES_H */
assume.h
Defines ASSUME / RB_LIKELY / UNREACHABLE.
long_long.h
Defines old LONG_LONG.
stdalign.h
Defines RUBY_ALIGNAS / RUBY_ALIGNOF.
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:106
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
dosish.h
Support for so-called dosish systems.
stdalign.h
Defines RBIMPL_ALIGNAS / RBIMPL_ALIGNOF.
memory.h
Memory management stuff.
stdarg.h
Defines old _.
xmalloc.h
Declares ruby_xmalloc().