Ruby  3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
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 
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"
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)
109 void rb_sparc_flush_register_windows(void);
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 */
Defines ASSUME / RB_LIKELY / UNREACHABLE.
Defines old LONG_LONG.
Defines RUBY_ALIGNAS / RUBY_ALIGNOF.
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:74
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:65
Support for so-called dosish systems.
Defines RBIMPL_ALIGNAS / RBIMPL_ALIGNOF.
Memory management stuff.
Defines old _.
Declares ruby_xmalloc().