[ruby-cvs:70662] shyouhei:r63571 (trunk): `int isnan(double)` is a POSIXism

shyouhei at ruby-lang.org shyouhei at ruby-lang.org
Tue Jun 5 15:50:20 JST 2018


shyouhei	2018-06-05 15:50:20 +0900 (Tue, 05 Jun 2018)

  New Revision: 63571

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63571

  Log:
    `int isnan(double)` is a POSIXism
    
    - `isnan` is something relatively new.  We need to provide one for
      those systems without it.  However:
    - X/Open defines `int isnan(double)`. Note the `int`.
    - C99 defines `isnan(x)` to be a macro.
    - C++11 nukes them all, undefines all the "masking macro"s, and
      defines its own `bool isnan(double)`.  Note the `bool`.
    - In C++, `int isnan(double)` and `bool isnan(double)` are
      incompatible.
    - So the mess.
    
    [Bug #14816][ruby-core:87364]
    further reading: https://developers.redhat.com/blog/2016/02/29/why-cstdlib-is-more-complicated-than-you-might-think/

  Modified files:
    trunk/include/ruby/missing.h


More information about the ruby-cvs mailing list