dearblue
1326017d1d
Omit the _WIN64 definition check
...
Checking the official MSVC documentation, if `_WIN64` is defined, then `_WIN32` is also defined.
https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros
I could not find any documentation on MinGW, but I assume it is not a problem.
2024-12-07 22:47:28 +09:00
Yukihiro "Matz" Matsumoto
ba8ee7b895
mruby-socket (inet_pton): need to initialize loop variable
2024-09-17 12:05:46 +09:00
Yukihiro "Matz" Matsumoto
921a54ef33
mruby-socket/socket.rb: done some small refactoring
2024-06-14 06:14:27 +09:00
Yukihiro "Matz" Matsumoto
39d577799f
mruby-socket: use presym for initialization
2024-06-14 06:14:07 +09:00
Yukihiro "Matz" Matsumoto
bff68cbf17
mruby-socket (inet_ntop): refactor addrinfo loop
2024-05-25 16:39:31 +09:00
Yukihiro "Matz" Matsumoto
4e824048c0
mruby-socket: adjust local variable declarations
2024-05-25 16:39:31 +09:00
Yukihiro "Matz" Matsumoto
87b358a342
Including header files in include/* by <>
2024-03-26 13:59:59 +09:00
Yukihiro "Matz" Matsumoto
771b56c796
mruby-socket: hide internal method new_with_prelude
...
- rename new_with_prelude to _new_with_prelude
- take a block instead of proc
2023-09-28 14:36:42 +09:00
Yukihiro "Matz" Matsumoto
8afb73f3e2
mruby-socket/socket.rb: should not call unix_path for non UNIX Addrinfo
...
ref #6051
2023-09-19 14:22:49 +09:00
Yukihiro "Matz" Matsumoto
52082ba399
mruby-socket/socket.c (mrb_addrinfo_unix_path): check sockaddr type
...
`sockaddr` should be a string; fix #6051
2023-09-19 14:22:49 +09:00
Yukihiro "Matz" Matsumoto
f43f2fc8f3
mruby-socket/socket.c: use internal name for instance variables
...
For Socket::Option objects.
2023-08-23 11:27:03 +09:00
Yukihiro "Matz" Matsumoto
2160be7db7
mruby-socket/socket.rb: remove unused canonname accessor
2023-08-22 23:27:08 +09:00
Yukihiro "Matz" Matsumoto
bd41dfbcb9
mruby-socket/socket.c (socket_option_inspect): readable family name
...
Print readable name for know protocol families.
2023-08-17 10:54:59 +09:00
Yukihiro "Matz" Matsumoto
58e10f16e9
mruby-socket/socket.c: include Socket::Constants in C init
2023-08-16 13:23:56 +09:00
Yukihiro "Matz" Matsumoto
1d7c00e920
mruby-socket/socket.c: implement whole Socket::Option class in C
...
`mruby-pack` gem no longer needed.
2023-08-15 15:29:36 +09:00
Yukihiro "Matz" Matsumoto
83b6a63c16
mruby-socket/socket.c: implement accessors in C
2023-08-15 07:35:29 +09:00
Yukihiro "Matz" Matsumoto
e209f0a220
mruby-socket/socket.c (socket_option_init): add integer type checks
2023-08-15 07:31:04 +09:00
Yukihiro "Matz" Matsumoto
892596d372
mruby-socket/socket.c: implement Socket::Option#initialize in C
2023-08-14 23:32:22 +09:00
Yukihiro "Matz" Matsumoto
435cce7efd
mruby-socket/socket.c: use mrb_iv_get() instead of accessors
2023-08-12 20:19:32 +09:00
Yukihiro "Matz" Matsumoto
c675c0cbb1
mruby-socket/socket.c: use mrb_ensure_int_type()
2023-08-11 23:10:02 +09:00
Yukihiro "Matz" Matsumoto
34e7a0ef4b
mruby-socket/socket.c (socket_option_class): a new function
...
To retrieve Socket::Option class from C functions.
2023-08-11 23:07:38 +09:00
Yukihiro "Matz" Matsumoto
0864f44c24
mruby-socket/socket.c: use mrb_obj_new() instead of mrb_obj_funcall()
2023-08-09 18:45:42 +09:00
Yukihiro "Matz" Matsumoto
08a780edd6
mruby-socket/socket.c: rename a local variable for clarity (res0 -> addr)
2023-08-09 14:33:14 +09:00
Yukihiro "Matz" Matsumoto
edf3f1226c
mruby-socket/socket.c: pass klass to gen_addrinfo
2023-08-09 14:33:14 +09:00
Yukihiro "Matz" Matsumoto
9e37a490f8
mruby-socket/socket.c: narrow local variable scope
2023-08-09 14:33:14 +09:00
Yukihiro "Matz" Matsumoto
10ed2ea03b
mruby-socket/socket.c: use z! argument specifier rather than o
...
`z!` specifier checks if the argument is NULL terminated string or nil.
2023-08-09 14:33:14 +09:00
Yukihiro "Matz" Matsumoto
9d370e0851
mruby-socket/socket.c: ensure struct addrinfo to be freed
...
Instead of referring the last addrinfo via Addrinfo's class variable, we
use `mrb_ensure()` from `mruby-error` gem.
2023-08-09 13:51:25 +09:00
Yukihiro "Matz" Matsumoto
0a4473bf64
mruby-socket/socket.c: fix indentation
2023-07-04 17:50:37 +09:00
Yukihiro "Matz" Matsumoto
89f7bb1056
use more lightweight mrb_funcall_argv instead of mrb_funcall_id
2023-06-12 14:22:04 +09:00
Yukihiro "Matz" Matsumoto
c32f7915fb
reformat else clause indentation style
2023-05-20 00:21:01 +09:00
Yukihiro "Matz" Matsumoto
eea72ec84a
fix spaces in the type cast expressions (cosmetic changes)
2023-05-18 23:29:16 +09:00
Yukihiro "Matz" Matsumoto
feb07d1d1a
Merge pull request #6002 from jbampton/standardize-whitespace-spec-authors
...
mrbgems: standardize `spec.authors` for whitespace and author name
2023-05-08 17:01:23 +09:00
John Bampton
63e170170e
mrbgems: standardize spec.authors for whitespace and author name
2023-05-06 06:06:29 +10:00
John Bampton
db3774ea45
docs: fix links, grammar and spelling in Markdown
2023-05-06 04:43:50 +10:00
Yukihiro "Matz" Matsumoto
42d3efee1c
mruby-socket/socket.c: read/write should be redefined on Windows; fix #5943
...
Since normal file descriptors and sockets cannot be mixed on the
platform.
2023-03-03 15:30:51 +09:00
Yukihiro "Matz" Matsumoto
f2d43069f0
mruby-socet: add socket constants
...
Introduced in Ruby3.2:
- SO_INCOMING_CPU
- SO_INCOMING_NAPI_ID
- SO_RTABLE
- SO_SETFIB
- SO_USER_COOKIE
- TCP_KEEPALIVE
- TCP_CONNECTION_INFO
2022-12-19 18:59:10 +09:00
John Bampton
696226a60e
docs: standardize Markdown lists
...
Previously for lists we were using both `*` and `-` to start the list items.
This pr changes all lists to use `-`.
2022-10-26 13:09:41 +10:00
dearblue
9a84ef926b
Avoid adding MRUBY_ROOT/src to cc.include_paths
2022-07-02 09:56: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
dearblue
f9d72908ca
Remove old compatibility code
...
The `mrb_voidp()` related macros have been removed in mruby-1.1.0.
2022-03-27 11:26:43 +09:00
Yukihiro "Matz" Matsumoto
6fa5aaf694
socket.c: unify error handling code.
2022-03-09 15:21:14 +09:00
Yukihiro "Matz" Matsumoto
2cb82803b3
socket.c: reorganize error condition in mrb_ipsocket_ntop().
2022-03-09 15:21:14 +09:00
Yukihiro "Matz" Matsumoto
a4f740ff9a
string.c: use mrb_int instead of size_t.
2022-03-03 08:08:02 +09:00
Yukihiro "Matz" Matsumoto
80b44c6ade
socket.c: avoid mrb_funcall_id() to retrieve file descriptor.
2022-02-22 11:46:02 +09:00
dearblue
621cafde68
Need to check the type of the method return value
2022-02-19 15:01:46 +09:00
mimaki
1f3a385ec5
Fix build error and refine definition of ssize_t on MSVC.
2021-12-28 17:18:59 +09:00
Yukihiro "Matz" Matsumoto
d6dd6f0e7b
Update struct initializer to work with relatively older C++.
2021-09-20 19:13:17 +09:00
Yukihiro "Matz" Matsumoto
8619ba6a38
Use struct initializer instead of memset.
2021-09-15 13:02:15 +09:00
Yukihiro "Matz" Matsumoto
5c804cf68f
Remove redundant include headers.
...
- stdlib.h
- stddef.h
- stdint.h
- stdarg.h
- limits.h
- float.h
2021-07-25 13:07:10 +09:00
John Bampton
188e9b6fb0
Enable markdownlint rules MD003,MD005,MD007
...
Lint Markdown
https://github.com/DavidAnson/markdownlint#rules--aliases
2021-06-22 06:57:03 +10:00