Project

General

Profile

Bug #11483

internal.h included after math.h in complex.c

Added by ReiOdaira (Rei Odaira) almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-08-23 trunk 51669) [powerpc-aix7.1.2.0]
[ruby-core:<unknown>]

Description

r51313 modified complex.c to include internal.h after math.h, so that ruby/missing.h (included from internal.h) can test whether M_PI is defined or not in math.h. Unfortunately, ruby/config.h, which is included from internal.h, defines _LARGE_FILES, which must be defined before sys/types.h is included from math.h. Otherwise, in AIX, off_t would be incorrectly defined as a 32-bit integer even when large files are used.

--- complex.c   (revision 51312)
+++ complex.c   (revision 51313)
@@ -5,12 +5,12 @@
   which is written in ruby.
 */

-#include "internal.h"
 #if defined _MSC_VER
 /* Microsoft Visual C does not define M_PI and others by default */
 # define _USE_MATH_DEFINES 1
 #endif
 #include <math.h>
+#include "internal.h"

 #define NDEBUG
 #include <assert.h>

There would be a couple of workarounds to fix this problem, but since I am relatively new to the Ruby core, I am wondering what would be the most acceptable way.


Related issues

Blocks Ruby trunk - Misc #11516: Ruby 2.3.0 release engeneeringClosedActions

Associated revisions

Revision c3b02d57
Added by odaira (takumi odaira) almost 4 years ago

complex.c: ruby/config.h must be included before math.h
because it defines _LARGE_FILES on AIX and _LARGE_FILES
must be defined before sys/types.h is included from math.h.
[Bug #11483]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 51922
Added by odaira almost 4 years ago

complex.c: ruby/config.h must be included before math.h
because it defines _LARGE_FILES on AIX and _LARGE_FILES
must be defined before sys/types.h is included from math.h.
[Bug #11483]

Revision 51922
Added by odaira almost 4 years ago

complex.c: ruby/config.h must be included before math.h
because it defines _LARGE_FILES on AIX and _LARGE_FILES
must be defined before sys/types.h is included from math.h.
[Bug #11483]

Revision 51922
Added by odaira almost 4 years ago

complex.c: ruby/config.h must be included before math.h
because it defines _LARGE_FILES on AIX and _LARGE_FILES
must be defined before sys/types.h is included from math.h.
[Bug #11483]

Revision 51922
Added by odaira almost 4 years ago

complex.c: ruby/config.h must be included before math.h
because it defines _LARGE_FILES on AIX and _LARGE_FILES
must be defined before sys/types.h is included from math.h.
[Bug #11483]

Revision 51922
Added by odaira almost 4 years ago

complex.c: ruby/config.h must be included before math.h
because it defines _LARGE_FILES on AIX and _LARGE_FILES
must be defined before sys/types.h is included from math.h.
[Bug #11483]

History

#1

Updated by naruse (Yui NARUSE) almost 4 years ago

  • Blocks Misc #11516: Ruby 2.3.0 release engeneering added
#2

Updated by ReiOdaira (Rei Odaira) almost 4 years ago

Possible options:

  1. Define M_PI and M_PI_2 in complex.c
  2. Define _LARGE_FILES not in config.h but in a compiler option
  3. Include ruby/config.h before math.h but keep internal.h included after math.h in complex.c
  4. Any other options?

Option 3 looks reasonable if it is allowed to directly include ruby/config.h.

#3

Updated by Anonymous almost 4 years ago

  • Status changed from Open to Closed

Applied in changeset r51922.


complex.c: ruby/config.h must be included before math.h
because it defines _LARGE_FILES on AIX and _LARGE_FILES
must be defined before sys/types.h is included from math.h.
[Bug #11483]

Also available in: Atom PDF