mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
rb_strlen_lit: support wide string literals
This commit is contained in:
2 files changed
+2
-2
Notes:
git
2024-11-10 14:27:40 +00:00
No files matched your search
@@ -1689,7 +1689,7 @@ rbimpl_exc_new_cstr(VALUE exc, const char *str)
|
||||
* @return An integer constant expression that represents `str`'s length,
|
||||
* in bytes, not including the terminating NUL character.
|
||||
*/
|
||||
#define rb_strlen_lit(str) (sizeof(str "") - 1)
|
||||
#define rb_strlen_lit(str) ((sizeof(str "") / sizeof(str ""[0])) - 1)
|
||||
|
||||
/**
|
||||
* Identical to rb_str_new_static(), except it cannot take string variables.
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
# define FALSE 0
|
||||
#endif
|
||||
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
|
||||
#define rb_strlen_lit(str) (sizeof(str "") - 1)
|
||||
#define rb_strlen_lit(str) ((sizeof(str "") / sizeof(str ""[0])) - 1)
|
||||
#undef FIXNUM_MAX
|
||||
#define FIXNUM_MAX (LONG_MAX / 2)
|
||||
|
||||
|
||||
Reference in new issue
Block a user