summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-24 03:38:14 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-24 03:38:14 +0000
commitb2f3063cae5cd5997a89717d91fdec06c5041620 (patch)
tree659206e5c7382f73ca808444e4c5d03ef11f6b43 /configure.in
parentba5ed845b30c81fbf92c052b83f54198cd272bbd (diff)
time: rearrange+pack vtm and time_object structs
struct time_object shrinks from 88 to 46 bytes on my 64-bit system. * configure.in: use -Wno-packed-bitfield-compat for GCC 4.4+ use __attribute__((packed)) if available * timev.h: shrink and pack struct vtm * time.c: pack struct time_object and adjust/introduce helpers [ruby-core:60794] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index ae93ea9642..8d7bfba55e 100644
--- a/configure.in
+++ b/configure.in
@@ -746,6 +746,7 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
-Werror=implicit-function-declaration \
-Werror=division-by-zero \
-Werror=deprecated-declarations \
+ -Wno-packed-bitfield-compat \
$extra_warning \
; do
if test "$particular_werror_flags" != yes; then
@@ -1271,6 +1272,15 @@ RUBY_CHECK_SIZEOF(double)
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>])
+AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
+ [AC_TRY_COMPILE([struct { int a; } __attribute__((packed));], [],
+ [rb_cv_packed_struct=yes], [rb_cv_packed_struct=no])])
+if test "$rb_cv_packed_struct" = yes; then
+ AC_DEFINE_UNQUOTED(PACKED_STRUCT, __attribute__((packed)))
+else
+ AC_DEFINE_UNQUOTED(PACKED_STRUCT,)
+fi
+
AC_DEFUN([RUBY_CHECK_PRINTF_PREFIX], [
AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[
[rb_cv_pri_prefix_]AS_TR_SH($1)=[NONE]