The R Project SVN R

Rev

Rev 84135 | Rev 84204 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 84135 Rev 84153
Line 33... Line 33...
33
# ifdef R_LEGACY_RCOMPLEX
33
# ifdef R_LEGACY_RCOMPLEX
34
 
34
 
35
/* This definition does not work with optimizing compilers which take
35
/* This definition does not work with optimizing compilers which take
36
advantage of strict aliasing rules.  It is not safe to use with Fortran
36
advantage of strict aliasing rules.  It is not safe to use with Fortran
37
COMPLEX*16 (PR#18430) or in arguments to library calls expecting C99
37
COMPLEX*16 (PR#18430) or in arguments to library calls expecting C99
38
_Complex double.  This old definition should not be used, but if it were
38
_Complex double.  This definition should not be used, but if it were still
39
still necessary, one should at least disable LTO.  This may be removed at
39
necessary, one should at least disable LTO.
40
any time.  */
40
*/
41
 
41
 
42
typedef struct {
42
typedef struct {
43
 	double r;
43
 	double r;
44
 	double i;
44
 	double i;
45
 } Rcomplex;
45
 } Rcomplex;
Line 52... Line 52...
52
about type punning when accessing the .r and .i elements, so is safer to use
52
about type punning when accessing the .r and .i elements, so is safer to use
53
when interfacing with Fortran COMPLEX*16 or directly C99 _Complex double
53
when interfacing with Fortran COMPLEX*16 or directly C99 _Complex double
54
(PR#18430).
54
(PR#18430).
55
 
55
 
56
This form of static initialization works with both definitions:
56
This form of static initialization works with both definitions:
57
Rcomplex z = { .r = 1, .i = 2 }; */
57
Rcomplex z = { .r = 1, .i = 2 };
-
 
58
 
-
 
59
Anonymous structures and C99 _Complex were not incorporated into C++
-
 
60
standard.  While they are usually supported as compiler extensions, warnings
-
 
61
are typically issued (-pedantic) by a C++ compiler.
-
 
62
*/
58
 
63
 
59
typedef union {
64
typedef union {
60
    struct {
65
    struct {
61
	double r;
66
	double r;
62
	double i;
67
	double i;