Skip to content
Browse files

add --disable-long-double and more support

git-svn-id: https://svn.r-project.org/R/trunk@60939 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent 8eb679d commit fb8e36f8be0aaf47a9c54c9effb219dae34f0e41 ripley committed Oct 14, 2012
Showing with 122 additions and 84 deletions.
  1. +76 −59 configure
  2. +16 −1 configure.ac
  3. +2 −3 doc/NEWS.Rd
  4. +4 −4 doc/manual/R-admin.texi
  5. +3 −3 m4/gettext.m4
  6. +1 −1 src/include/config.h.in
  7. +12 −9 src/library/base/man/zMachine.Rd
  8. +4 −4 src/main/connections.c
  9. +4 −0 src/main/platform.c
View
135 configure
@@ -1158,6 +1158,7 @@ enable_static
enable_shared
with_pic
enable_fast_install
+enable_long_double
enable_openmp
with_x
enable_largefile
@@ -1870,6 +1871,7 @@ Optional Features:
--enable-static[=PKGS] (libtool) build static libraries [default=no]
--enable-shared[=PKGS] (libtool) build shared libraries [default=yes]
+ --enable-long-double use long double type [yes]
--disable-openmp do not use OpenMP
--disable-largefile omit support for large files
--disable-nls do not use Native Language Support
@@ -8940,13 +8942,13 @@ if ${lt_cv_nm_interface+:} false; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:8943: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:8945: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:8946: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:8948: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:8949: output\"" >&5)
+ (eval echo "\"\$as_me:8951: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -11794,11 +11796,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11797: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11799: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11801: \$? = $ac_status" >&5
+ echo "$as_me:11803: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12133,11 +12135,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12136: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12138: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12140: \$? = $ac_status" >&5
+ echo "$as_me:12142: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12238,11 +12240,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12241: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12243: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12245: \$? = $ac_status" >&5
+ echo "$as_me:12247: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -12293,11 +12295,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12296: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12298: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12300: \$? = $ac_status" >&5
+ echo "$as_me:12302: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14660,7 +14662,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 14663 "configure"
+#line 14665 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14756,7 +14758,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 14759 "configure"
+#line 14761 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16705,11 +16707,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16708: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16710: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16712: \$? = $ac_status" >&5
+ echo "$as_me:16714: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16804,11 +16806,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16807: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16809: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16811: \$? = $ac_status" >&5
+ echo "$as_me:16813: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16856,11 +16858,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16859: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16861: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16863: \$? = $ac_status" >&5
+ echo "$as_me:16865: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -18236,11 +18238,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18239: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18241: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:18243: \$? = $ac_status" >&5
+ echo "$as_me:18245: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -18335,11 +18337,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18338: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18340: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:18342: \$? = $ac_status" >&5
+ echo "$as_me:18344: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -18387,11 +18389,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18390: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18392: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:18394: \$? = $ac_status" >&5
+ echo "$as_me:18396: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -22403,68 +22405,88 @@ _ACEOF
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
-$as_echo_n "checking size of long double... " >&6; }
-if ${ac_cv_sizeof_long_double+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
+if ${ac_cv_sizeof_size_t+:} false; then :
$as_echo_n "(cached) " >&6
else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then :
else
- if test "$ac_cv_type_long_double" = yes; then
+ if test "$ac_cv_type_size_t" = yes; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long double)
+as_fn_error 77 "cannot compute sizeof (size_t)
See \`config.log' for more details" "$LINENO" 5; }
else
- ac_cv_sizeof_long_double=0
+ ac_cv_sizeof_size_t=0
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
-$as_echo "$ac_cv_sizeof_long_double" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
_ACEOF
-# The cast to long int works around a bug in the HP C Compiler
+# Check whether --enable-long-double was given.
+if test "${enable_long_double+set}" = set; then :
+ enableval=$enable_long_double; if test "${enableval}" = no; then
+ use_long_double=no
+else
+ use_long_double=yes
+fi
+else
+ use_long_double=yes
+fi
+
+
+if test "x${use_long_double}" = xyes; then
+
+$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
+
+ # The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
-$as_echo_n "checking size of size_t... " >&6; }
-if ${ac_cv_sizeof_size_t+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
+$as_echo_n "checking size of long double... " >&6; }
+if ${ac_cv_sizeof_long_double+:} false; then :
$as_echo_n "(cached) " >&6
else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then :
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :
else
- if test "$ac_cv_type_size_t" = yes; then
+ if test "$ac_cv_type_long_double" = yes; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (size_t)
+as_fn_error 77 "cannot compute sizeof (long double)
See \`config.log' for more details" "$LINENO" 5; }
else
- ac_cv_sizeof_size_t=0
+ ac_cv_sizeof_long_double=0
fi
fi
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
-$as_echo "$ac_cv_sizeof_size_t" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
+$as_echo "$ac_cv_sizeof_long_double" >&6; }
cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
_ACEOF
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Not using the 'long double' type" >&5
+$as_echo "$as_me: WARNING: Not using the 'long double' type" >&2;}
+fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compute C Make dependencies" >&5
@@ -23028,7 +23050,7 @@ _ACEOF
# flags.
r_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $r_verb"
-(eval echo $as_me:23031: \"$ac_link\") >&5
+(eval echo $as_me:23053: \"$ac_link\") >&5
r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$r_c_v_output" >&5
CFLAGS=$r_save_CFLAGS
@@ -23103,7 +23125,7 @@ _ACEOF
# flags.
r_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $r_cv_prog_c_v"
-(eval echo $as_me:23106: \"$ac_link\") >&5
+(eval echo $as_me:23128: \"$ac_link\") >&5
r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
echo "$r_c_v_output" >&5
CFLAGS=$r_save_CFLAGS
@@ -36023,11 +36045,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:36026: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:36048: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:36030: \$? = $ac_status" >&5
+ echo "$as_me:36052: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -36122,11 +36144,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:36125: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:36147: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:36129: \$? = $ac_status" >&5
+ echo "$as_me:36151: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -36174,11 +36196,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:36177: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:36199: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:36181: \$? = $ac_status" >&5
+ echo "$as_me:36203: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -40689,11 +40711,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_long_double" >&5
$as_echo "$gt_cv_c_long_double" >&6; }
- if test $gt_cv_c_long_double = yes; then
-
-$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
-
- fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
View
17 configure.ac
@@ -844,8 +844,23 @@ esac
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(double)
-AC_CHECK_SIZEOF(long double)
AC_CHECK_SIZEOF(size_t)
+AC_ARG_ENABLE([long-double],
+[AS_HELP_STRING([--enable-long-double],[use long double type @<:@yes@:>@])],
+[if test "${enableval}" = no; then
+ use_long_double=no
+else
+ use_long_double=yes
+fi],
+[use_long_double=yes])
+
+dnl also used in intl.
+if test "x${use_long_double}" = xyes; then
+ AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you wish to use the 'long double' type.])
+ AC_CHECK_SIZEOF(long double)
+else
+ AC_MSG_WARN([Not using the 'long double' type])
+fi
R_PROG_CC_MAKEFRAG
R_PROG_CC_LO_MAKEFRAG
View
5 doc/NEWS.Rd
@@ -517,9 +517,8 @@
\itemize{
\item There is again support for building without using the C
\sQuote{long double} type. This is required by C99, but system
- implementations can be slow or flawed. Simply undefine
- \code{HAVE_LONG_DOUBLE} in \file{src/include/config.h} after
- configuration.
+ implementations can be slow or flawed. Use \command{configure}
+ option \option{--disable-long-double}.
}
}
View
8 doc/manual/R-admin.texi
@@ -4351,11 +4351,11 @@ Some people have reported that the Solaris @code{libintl} needs to be
avoided, for example by using @option{--disable-nls} or
@option{--with-included-gettext} or using @code{libintl} from OpenCSW.
-The support for the C99 @code{long double} on Sparc hardware uses
+The support for the C99 @code{long double} type on Sparc hardware uses
quad-precision arithmetic, and this is usually slow because it is done
-by software emulation. On such systems @code{HAVE_LONG_DOUBLE} in
-@file{src/include/config.h} can be undefined for faster but less
-accurate computations.
+by software emulation. On such systems @command{configure} option
+@option{--disable-long-double} can be used for faster but less accurate
+computations.
When using the Oracle compilers@footnote{including @command{gcc} for
View
6 m4/gettext.m4
@@ -1382,9 +1382,9 @@ AC_DEFUN([gt_TYPE_LONGDOUBLE],
], ,
gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
fi])
- if test $gt_cv_c_long_double = yes; then
- AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type. (For intl)])
- fi
+dnl if test $gt_cv_c_long_double = yes; then
+dnl AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type. (For intl)])
+dnl fi
])
# longlong.m4 serial 8
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
View
2 src/include/config.h.in
@@ -444,7 +444,7 @@
/* Define to 1 if you have the `log2' function. */
#undef HAVE_LOG2
-/* Define if you have the 'long double' type. (For intl) */
+/* Define if you wish to use the 'long double' type. */
#undef HAVE_LONG_DOUBLE
/* Define to 1 if the system has the type `long long int'. (For intl) */
View
21 src/library/base/man/zMachine.Rd
@@ -1,14 +1,15 @@
% File src/library/base/man/zMachine.Rd
% Part of the R package, http://www.R-project.org
-% Copyright 1995-2010 R Core Team
+% Copyright 1995-2012 R Core Team
% Distributed under GPL 2 or later
\name{.Machine}
+\alias{.Machine}
+\concept{long double}
\title{Numerical Characteristics of the Machine}
\usage{
.Machine
}
-\alias{.Machine}
\description{
\code{.Machine} is a variable holding information on the numerical
characteristics of the machine \R is running on, such as the largest
@@ -58,7 +59,8 @@
with truncating arithmetic. It is 1 if floating-point arithmetic
truncates and more than \code{double digits} base-\code{double.base} digits
participate in the post-normalization shift of the floating-point
- significand in multiplication, and 0 otherwise.}
+ significand in multiplication, and 0 otherwise.\cr
+ Normally \code{0}.}
\item{double.ulp.digits}{the largest negative integer \code{i} such
that \code{1 + double.base ^ i != 1}, except that it is bounded below by
\code{-(double.digits + 3)}. Normally \code{-52}.}
@@ -83,25 +85,26 @@
type. Will be zero if there is no such type, otherwise usually
\code{8}.}
\item{sizeof.longdouble}{the number of bytes in a C \code{long double}
- type. Will be zero if there is no such type, otherwise possibly
+ type. Will be zero if there is no such type (or its use was
+ disabled when \R was built), otherwise possibly
\code{12} (most 32-bit builds) or \code{16} (most 64-bit builds).}
\item{sizeof.pointer}{the number of bytes in a C \code{SEXP}
type. Will be \code{4} on 32-bit builds and \code{8} on 64-bit
builds of \R.}
}
\details{
- The algorithm is based on Cody's (1988) subroutine MACHAR. As
- all current implementations of \R use 32-bit integers and almost all
- use IEC 60559 floating-point (double precision) arithmetic, all but
- the last two values are the same for almost all \R builds.
+ The algorithm is based on Cody's (1988) subroutine MACHAR. As all
+ current implementations of \R use 32-bit integers and use IEC 60559
+ floating-point (double precision) arithmetic, all but the last two
+ values are the same for almost all \R builds.
Note that on most platforms smaller positive values than
\code{.Machine$double.xmin} can occur. On a typical \R platform the
smallest positive double is about \code{5e-324}.
}
\note{
\code{sizeof.longdouble} only tells you the amount of storage
- allocated for a long double (which are used internally by \R for
+ allocated for a long double (which are normally used internally by \R for
accumulators in e.g. \code{\link{sum}}, and can be read by
\code{\link{readBin}}). Often what is stored is the 80-bit extended
double type of IEC 60559, padded to the double alignment used on the
View
8 src/main/connections.c
@@ -3668,7 +3668,7 @@ SEXP attribute_hidden do_readbin(SEXP call, SEXP op, SEXP args, SEXP env)
switch (size) {
case sizeof(double):
case sizeof(float):
-#if SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE
+#if HAVE_LONG_DOUBLE && (SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE)
case sizeof(long double):
#endif
break;
@@ -3745,7 +3745,7 @@ SEXP attribute_hidden do_readbin(SEXP call, SEXP op, SEXP args, SEXP env)
case sizeof(float):
REAL(ans)[i] = (double)*((float *)buf);
break;
-#if SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE
+#if HAVE_LONG_DOUBLE && (SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE)
case sizeof(long double):
REAL(ans)[i] = (double)*((long double *)buf);
break;
@@ -3887,7 +3887,7 @@ SEXP attribute_hidden do_writebin(SEXP call, SEXP op, SEXP args, SEXP env)
switch (size) {
case sizeof(double):
case sizeof(float):
-#if SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE
+#if HAVE_LONG_DOUBLE && (SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE)
case sizeof(long double):
#endif
break;
@@ -3968,7 +3968,7 @@ SEXP attribute_hidden do_writebin(SEXP call, SEXP op, SEXP args, SEXP env)
}
break;
}
-#if SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE
+#if HAVE_LONG_DOUBLE && (SIZEOF_LONG_DOUBLE > SIZEOF_DOUBLE)
case sizeof(long double):
{
/* some systems have problems with memcpy from
View
4 src/main/platform.c
@@ -120,7 +120,11 @@ static void Init_R_Machine(SEXP rho)
SET_VECTOR_ELT(ans, 15, ScalarInteger(SIZEOF_LONG_LONG));
SET_STRING_ELT(nms, 16, mkChar("sizeof.longdouble"));
+#ifdef HAVE_LONG_DOUBLE
SET_VECTOR_ELT(ans, 16, ScalarInteger(SIZEOF_LONG_DOUBLE));
+#else
+ SET_VECTOR_ELT(ans, 16, ScalarInteger(0));
+#endif
SET_STRING_ELT(nms, 17, mkChar("sizeof.pointer"));
SET_VECTOR_ELT(ans, 17, ScalarInteger(sizeof(SEXP)));

0 comments on commit fb8e36f

Please sign in to comment.
Something went wrong with that request. Please try again.