Commit graph

7506 commits

Author SHA1 Message Date
Chris Seaton
3015a7aae7 [ruby/fiddle] Improve documentation on how to correctly free memory and free memory in tests (#33)
e59cfd708a
2020-05-23 14:34:07 +09:00
Sutou Kouhei
24b615e82e [ruby/fiddle] Export Fiddle::VERSION
1b93a2d9db
2020-05-23 14:29:16 +09:00
Sutou Kouhei
74a4558c14 [ruby/fiddle] Update file list
b04cb92d7b
2020-05-23 14:29:16 +09:00
Sutou Kouhei
d5c0018a9a [ruby/fiddle] Fix a typo
445ca6b501
2020-05-23 14:29:16 +09:00
Sutou Kouhei
a0dcdd64c5 [ruby/fiddle] Bump version
f8fb7c4823
2020-05-23 14:29:16 +09:00
Sutou Kouhei
13f64333ea [ruby/fiddle] Add Fiddle::VERSION
9dcf64c096
2020-05-23 14:29:16 +09:00
Sutou Kouhei
5fb7ca33e6 [ruby/fiddle] Add missing spec.extensions
2ce36b1fdc
2020-05-23 14:29:16 +09:00
sinisterchipmunk
77cc13943c [ruby/fiddle] Fix assignment to array within struct (#26)
* Allow access to a struct's underlying memory with `struct[offset, length]`.

24083690a6
2020-05-23 14:29:16 +09:00
sinisterchipmunk
4a835621ce [ruby/fiddle] Make array access override compatible with base class (#25)
* Allow access to a struct's underlying memory with `struct[offset, length]`.

* Make accessing a struct's underlying memory more convenient.

* refactor memory access unit tests for improved clarity


c082c81bb5
2020-05-23 14:29:16 +09:00
sinisterchipmunk
aa1d3c7d2c [ruby/fiddle] Initialize memory to 0 when calling Fiddle.malloc(). (#24)
8414239ca3
2020-05-23 14:29:16 +09:00
Kenta Murata
f4f157fc81
Suppress warnings no inline ruby debug (#3107)
* Suppress unused warnings occurred due to -fno-inline

* Suppress warning occurred due to RUBY_DEBUG=1
2020-05-22 13:49:08 +09:00
Samuel Williams
0e3b0fcdba
Thread scheduler for light weight concurrency. 2020-05-14 22:10:55 +12:00
Yusuke Endoh
8bd27c547c ext/json/parser/prereq.mk: remove type-limit warning if char is unsigned
Ragel generates a code `0 <= (*p)` where `*p` is char.
As char is unsigned by default on arm and RISC-V, it is warned by gcc:

```
compiling parser.c
parser.c: In function ‘JSON_parse_string’:
parser.c:1566:2: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  if ( 0 <= (*p) && (*p) <= 31 )
  ^
parser.c:1596:2: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  if ( 0 <= (*p) && (*p) <= 31 )
  ^
```

This change removes the warning by substituting the condition with
`0 <= (signed char)(*p)`.
2020-05-14 00:44:35 +09:00
Kazuki Yamaguchi
87662134b5 [ruby/openssl] Ruby/OpenSSL 2.2.0
41587f69e1
2020-05-13 15:47:51 +09:00
Kazuki Yamaguchi
cc26638cae [ruby/openssl] ssl: temporarily remove SSLContext#add_certificate_chain_file
Let's revert the changes for now, as it cannot be included in the 2.2.0
release.

My comment on #257:

> A blocker is OpenSSL::SSL::SSLContext#add_certificate_chain_file. It
> has a pending change and I don't want to include it in an incomplete
> state.
>
> The initial implementation in commit 46e4bdba40c5 was not really
> useful. The issue is described in #305. #309 extended it
> to take the corresponding private key together. However, the new
> implementation was incompatible on Windows and was reverted by #320 to
> the initial one.
>
> (The prerequisite to implement it in) an alternative way is #288, and
> it's still cooking.

This effectively reverts the following commits:

 - dacd08937ccd ("ssl: suppress test failure with SSLContext#add_certificate_chain_file", 2020-03-09)
 - 46e4bdba40c5 ("Add support for SSL_CTX_use_certificate_chain_file. Fixes #254.", 2019-06-13)

ea925619a9
2020-05-13 15:47:51 +09:00
Kazuki Yamaguchi
6f008c9d2f [ruby/openssl] pkey: add PKey#inspect and #oid
Implement OpenSSL::PKey::PKey#oid as a wrapper around EVP_PKEY_id().
This allows user code to check the type of a PKey object.

EVP_PKEY can have a pkey type for which we do not provide a dedicated
subclass. In other words, an EVP_PKEY that is not any of {RSA,DSA,DH,EC}
can exist. It is currently not possible to distinguish such a pkey.

Also, implement PKey#inspect to include the key type for convenience.

dafbb1b3e6
2020-05-13 15:47:51 +09:00
Bart de Water
a7145c3de4 [ruby/openssl] Fix signing example to not use Digest instance
033fb4fbe4
2020-05-13 15:47:51 +09:00
Bart de Water
c85789f9b2 [ruby/openssl] Look up cipher by name instead of constant
b08ae7e73d
2020-05-13 15:47:51 +09:00
Bart de Water
b44cc9f040 [ruby/openssl] Remove 'mapping between Digest class and sn/ln'
This is not present in the referenced files anymore, and not useful to most users

eae30d2b96
2020-05-13 15:47:51 +09:00
Bart de Water
0b2c70eaa1 [ruby/openssl] Look up digest by name instead of constant
b28fb2f05c
2020-05-13 15:47:51 +09:00
Bart de Water
3f8665fe0e [ruby/openssl] Add Marshal support to PKey objects
c4374ff041
2020-05-13 15:47:51 +09:00
Yusuke Endoh
61d451d6ce ext/bigdecimal/bigdecimal.c, ext/date/date_core.c: undef NDEBUG
`#define NDEBUG` produces "macro redefined" warnings when it is already
defined via cppflags
2020-05-13 13:49:21 +09:00
Yusuke Endoh
3bca1b6aad ext/openssl/ossl.h: Remove a variable that is used only in assert
It produces "unused variable" warnings in NDEBUG mode
2020-05-13 13:45:31 +09:00
Yusuke Endoh
b68dab8667 ext/fiddle/extconf.rb: Fix the condition of libffi <= 3.1
ver is [3, 1, 0] which is not less then or equal to [3, 1]
2020-05-13 10:57:14 +09:00
Yusuke Endoh
9cfa811b0f Do not try ffi_closure_alloc if libffi is <= 3.1
Maybe due to e1855100e4, CentOS, RHEL, and
Fedora CIs have started failing with SEGV.  Try to avoid
ffi_closure_alloc on those environments.

20200512T183004Z.fail.html.gz
20200512T183004Z.fail.html.gz
20200512T183003Z.fail.html.gz
2020-05-13 08:42:48 +09:00
Yusuke Endoh
e1855100e4 ext/fiddle/extconf.rb: check if ffi_closure_alloc is available
to define HAVE_FFI_CLOSURE_ALLOC.
The macro is used in closure.c, so have_func check is needed.

If pkg-config is not installed, extconf.rb fails to detect the version
of libffi, and does not add "-DUSE_FFI_CLOSURE_ALLOC=1" even when system
libffi version is >= 3.2.

If USE_FFI_CLOSURE_ALLOC is not defined, closure.c attempts to check if
HAVE_FFI_CLOSURE_ALLOC is defined or not, but have_func was removed with
528a3a1797, so the macro is always not
defined.

This resulted in this deprecation warning:

20200512T123003Z.log.html.gz
```
compiling closure.c
closure.c: In function 'initialize':
closure.c:265:5: warning: 'ffi_prep_closure' is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
  265 |     result = ffi_prep_closure(pcl, cif, callback, (void *)self);
      |     ^~~~~~
In file included from ./fiddle.h:42,
                 from closure.c:1:
/usr/include/x86_64-linux-gnu/ffi.h:334:1: note: declared here
  334 | ffi_prep_closure (ffi_closure*,
      | ^~~~~~~~~~~~~~~~
```
2020-05-13 01:17:30 +09:00
Nobuyoshi Nakada
317fdd6df2 fiddle: share the same config tools 2020-05-12 15:57:47 +09:00
Nobuyoshi Nakada
d1748484e8 extlibs.rb: added variable references
Reduce duplicate parts such as package name and version numbers.
2020-05-12 15:57:47 +09:00
卜部昌平
9e41a75255 sed -i 's|ruby/impl|ruby/internal|'
To fix build failures.
2020-05-11 09:24:08 +09:00
卜部昌平
d7f4d732c1 sed -i s|ruby/3|ruby/impl|g
This shall fix compile errors.
2020-05-11 09:24:08 +09:00
Nobuyoshi Nakada
f169931414
win32ole: separate global variable declarations and definitions
https://gcc.gnu.org/gcc-10/changes.html#c

> * GCC now defaults to `-fno-common`.  As a result, global
>   variable accesses are more efficient on various targets.  In
>   C, global variables with multiple tentative definitions now
>   result in linker errors.  With `-fcommon` such definitions are
>   silently merged during linking.
2020-05-10 21:37:59 +09:00
Nobuyoshi Nakada
be575a6eef
[ruby/io-console] Use sys_fail_fptr macro
2b8ba023c8
2020-05-09 17:05:14 +09:00
Nobuyoshi Nakada
0ce45db115 [ruby/io-console] Show path name at error
6a4b1c1a6d
2020-05-09 13:56:55 +09:00
Kazuki Tsujimoto
6ed7bc83ec
Fix indentation 2020-05-04 13:27:25 +09:00
Nobuyoshi Nakada
b7e1eda932
Suppress warnings by gcc 10.1.0-RC-20200430
* Folding results should not be empty.

  If `OnigCodePointCount(to->n)` were 0, `for` loop using `fn`
  wouldn't execute and `ncs` elements are not initialized.

  ```
  enc/unicode.c:557:21: warning: 'ncs[0]' may be used uninitialized in this function [-Wmaybe-uninitialized]
    557 |  for (i = 0; i < ncs[0]; i++) {
        |                  ~~~^~~
  ```

* Cast to `enum yytokentype`

  Additional enums for scanner events by ripper are not included
  in `yytokentype`.

  ```
  ripper.y:7274:28: warning: implicit conversion from 'enum <anonymous>' to 'enum yytokentype' [-Wenum-conversion]
  ```
2020-05-04 12:28:24 +09:00
Nobuyoshi Nakada
520ac5da22
[pty] do not check openpty twice if found in util library 2020-05-01 10:58:27 +09:00
Kazuhiro NISHIYAMA
6560ff6e36
Fix a typo [ci skip] 2020-04-27 00:54:16 +09:00
Nobuyoshi Nakada
75a0447c15
Suppress C4267 "possible loss of data" warnings
Just cast down explicitly.
2020-04-17 09:24:46 +09:00
Nobuyoshi Nakada
a0bc3f2a1c
Suppress C4267 "possible loss of data" warnings 2020-04-17 00:53:26 +09:00
Nobuyoshi Nakada
7a85d31c29
[ruby/date] Suppress -Wchar-subscripts warnings by Cygwin gcc 9.3.0
9968eb69f0
2020-04-14 15:13:40 +09:00
卜部昌平
defc0ee9d1 ext/-test-/cxxanyargs: add #pragma for icc. 2020-04-10 16:17:30 +09:00
Nobuyoshi Nakada
97f73bd0e2
Ignore upper bits of pw_change on macOS too 2020-04-09 12:23:15 +09:00
Nobuyoshi Nakada
f099bb040c
Ignore upper bits of pw_expire on macOS
`pw_expire` is declared as `time_t`, but actually not, and
`getpwuid` returns a garbage there.

Also the declaration of `struct passwd` in pwd.h and the manual
page contradict each other, interal `pw_fields` is mentioned only
in the latter.  Maybe there is a confusion.
2020-04-09 09:44:18 +09:00
Nobuyoshi Nakada
d8720eb7de
Suppress -Wshorten-64-to-32 warnings 2020-04-08 16:28:38 +09:00
Nobuyoshi Nakada
e474c189da
Suppress -Wswitch warnings 2020-04-08 15:13:37 +09:00
卜部昌平
9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Kazuhiro NISHIYAMA
810d66f3e7
Fix a typo [ci skip] 2020-04-03 14:37:28 +09:00
Nobuyoshi Nakada
78b6eb9f9f
[ruby/etc] Deprecate names under Struct
25c538120c
2020-04-02 22:01:01 +09:00
Nobuyoshi Nakada
bd0a7d8dd5
Revert "[ruby/etc] Deprecate names under Struct"
This reverts commit 69f698d85a.

Again.
2020-04-02 22:00:00 +09:00
Nobuyoshi Nakada
11ddfd4c91
Revert "[ruby/etc] Hack to get rid of linking against static library"
This reverts commit 5885550c8c.

It didn't work without `--enable-shared`.
2020-04-02 21:59:33 +09:00