Yukihiro "Matz" Matsumoto
89a34e1b7e
Revert "error.c (mrb_sys_fail): errno argument removed from _sys_fail."
...
Intermediate function calls may update `errno`.
This reverts commit a099ca44f4 .
2022-11-19 17:11:56 +09:00
Yukihiro "Matz" Matsumoto
a099ca44f4
error.c (mrb_sys_fail): errno argument removed from _sys_fail.
...
As a side effect, `errno.h` dependency removed from `error.c`.
2022-11-15 13:27:32 +09:00
Yukihiro "Matz" Matsumoto
84c26870d2
mruby-errno/errno.c (mrb_errno_list): no need to check array type here.
2022-10-16 23:20:49 +09:00
Yukihiro "Matz" Matsumoto
9caa4d642c
errno.rb: fixed a typo.
2022-09-18 08:01:07 +09:00
Yukihiro "Matz" Matsumoto
3d125aeb89
errno.c (mrb_exxx_init): simplify the function.
...
Code duplication with mrb_sce_init has been unified.
2022-09-18 07:59:36 +09:00
Yukihiro "Matz" Matsumoto
db536da412
errno.c (mrb_sce_sys_fail): SystemCallError may be overridden; fix #5793
2022-09-18 00:07:28 +09:00
dearblue
50ea98e76d
Retrieve the StandardError class from mrb_state
2022-09-17 22:03:52 +09:00
Yukihiro "Matz" Matsumoto
f1f8221bf3
Merge pull request #5747 from dearblue/errno-summary
...
Added summary for `mrbgems/mruby-errno`
2022-07-15 13:45:09 +09:00
Yukihiro "Matz" Matsumoto
1d8f4bc775
Merge pull request #5746 from dearblue/cleanup-errno
...
Delete unnecessary files in `mrbgems/mruby-errno`
2022-07-15 13:44:35 +09:00
dearblue
bd98b71668
Added summary for mrbgems/mruby-errno
2022-07-14 21:55:15 +09:00
dearblue
a74b0fb62b
Delete unnecessary files in mrbgems/mruby-errno
...
This is because it has been integrated into the mruby repository.
2022-07-14 21:53:03 +09:00
dearblue
66b72430e6
Allow negative errno to be handled as well
2022-07-14 21:49:44 +09:00
dearblue
c14e26d79e
Define Errno::EXXX when needed
...
If the `Errno::EXXX` class is defined minimally when needed, it will save about 17 KiB of RAM in a 32-bit environment.
Define the singular methods `.const_defined?`, `.const_missing` and `.constants` in the `Errno` module and act as if there are classes that have not yet been defined.
However, if real classes are enumerated, for example by the following code, the effect is lost.
```ruby
Errno.constants.map { |id| Errno.const_get(id) }
```
But I believe that such codes are rarely written with the intention of being written.
In this patch, the `Errno::EXXX#initialize` method is no longer defined for further memory reduction.
Instead, it has been merged into the `SystemCallError#initialize` method.
2022-07-10 20:53:55 +09:00
dearblue
9a84ef926b
Avoid adding MRUBY_ROOT/src to cc.include_paths
2022-07-02 09:56:13 +09:00
Yukihiro "Matz" Matsumoto
bdc244e9b0
mruby-errno/errno.c: fix integer size mixtures.
2022-04-21 14:47:15 +09:00
Yukihiro "Matz" Matsumoto
2f918f1926
errno.c: fix int and mrb_int mixture.
...
`strerror(3) takes `int` not `mrb_int`.
2022-04-12 16:11:01 +09:00
Yukihiro "Matz" Matsumoto
3dabd18dcc
errno.c: resolve signedness warning.
2022-04-02 18:25:13 +09:00
Yukihiro "Matz" Matsumoto
b99c389ec3
internal.h: aggregate internal functions.
...
Internal functions can only be called from within the library.
Functions listed in `mruby/internal.h` can be called from:
* core (src/*.c)
* gems (mrbgems/**/*.c)
But not from the application linked with `libmruby`.
2022-04-02 18:25:13 +09:00
Yukihiro "Matz" Matsumoto
ad3ce7b41c
Merge pull request #5642 from dearblue/errmesg
...
Avoid direct access to error messages as instance variables
2022-02-13 20:59:47 +09:00
Yukihiro "Matz" Matsumoto
6cc6d9b078
Merge pull request #5644 from dearblue/errno-nopresym
...
Support `disable_presym` for `mrbgems/mruby-errno`
2022-02-07 16:05:22 +09:00
dearblue
0a4f21c60f
Support disable_presym for mrbgems/mruby-errno
...
The `mrbgems/mruby-errno/src/known_errors_def.cstub` file has been extended, so the `mrbgems/mruby-errno/src/known_errors_e2c.cstub` file is no longer needed.
2022-02-06 18:39:46 +09:00
dearblue
a82220211d
Support MRB_NO_STDIO for mrbgems/mruby-errno
2022-02-06 16:12:41 +09:00
dearblue
d6773cbd71
Avoid direct access to error messages as instance variables
...
ref. #2485
The `SystemCallError#to_s` method also needed to be modified, but since it has no functional difference from the `Exception#to_s` method, it will be removed.
2022-02-06 15:45:13 +09:00
Chris Reuter
198e10473b
Updated mruby-errno/README.md to pass the lint checks.
2022-01-29 18:40:05 -05:00
Yukihiro "Matz" Matsumoto
c5bdfe1bd4
mruby-errno: add errno constants to known_errors.def.
...
Add unlisted errno constants found in macOS and FreeBSD.
If you see unlisted errno, please report.
2022-01-26 12:58:52 +09:00
Yukihiro "Matz" Matsumoto
b7cdb59f26
errno.c: stop generating Errno::Exxx error classes on the fly.
2022-01-26 12:29:19 +09:00
Yukihiro "Matz" Matsumoto
dd93dd7419
errno.c: refactor _sys_fail to avoid mrb_funcall.
2022-01-25 16:01:33 +09:00
Yukihiro "Matz" Matsumoto
9892742d27
errno.c: use C array instead of a hash table to lookup a errno class.
...
To reduce memory consumption by avoiding allocating Ruby objects.
2022-01-25 11:15:34 +09:00
Yukihiro "Matz" Matsumoto
194d0c6f46
mruby-errno: change the format of known_errors_e2c.cstub.
2022-01-25 11:08:52 +09:00
Yukihiro "Matz" Matsumoto
5c7338491c
errno.c: use mrb_fixnum_p() instead of mrb_type().
2022-01-25 10:39:13 +09:00
Yukihiro "Matz" Matsumoto
6744d69d3d
errno.c: replace string literals by MRB_SYM().
2022-01-25 10:39:13 +09:00
Yukihiro "Matz" Matsumoto
1e866dffc4
errno.c: bundled mrbgem need not to support mruby 1.x.
2022-01-25 10:28:50 +09:00
Yukihiro "Matz" Matsumoto
0f5829795e
errno.c: use MRB_SYM() instead of mrb_intern_lit().
2022-01-25 10:26:34 +09:00
Yukihiro "Matz" Matsumoto
3b5486e3ae
mruby-errno/test: update test suites not to report warnings.
2022-01-25 10:22:28 +09:00
Yukihiro "Matz" Matsumoto
3a15d18ebb
errno.c: hide internal _sys_fail from backtrace.
2022-01-24 18:14:28 +09:00
Yukihiro "Matz" Matsumoto
a60073d7b9
mruby-errno: remove .gitkeep.
2022-01-24 18:07:59 +09:00
Yukihiro "Matz" Matsumoto
0a6d57ab3c
Merge remote-tracking branch 'mruby-errno/master'
2022-01-24 17:58:41 +09:00
Yukihiro "Matz" Matsumoto
2adf32a3f4
add mruby-errno directory
2022-01-24 16:42:36 +09:00