Hi Bram,

2013/07/30 Tue 5:15:49 UTC+9 Bram Moolenaar wrote:
> OK.  Is _USE_32BIT_TIME_T only used by Perl or does it affect the whole
> of Vim?

It affects the whole of Vim. So we have to consider other if_*s.
I confirmed that if_python/python3/ruby worked fine with or without
_USE_32BIT_TIME_T. I didn't check if_mzsch and if_tcl. (Note that
ActiveTcl 8.5 is also compiled by VC6.)

Another way is applying _USE_32BIT_TIME_T only to if_perl.
Please check the attached patch.
We have to make sure that we don't use time_t to exchange data
between if_perl.xs and the other part of Vim.

I'm not sure which patch is better.


> Would there be a way to handle it in the code somehow, with
> sizeof(time_t)?

I think it's difficult. A struct named "interpreter" has a time_t typed
member "basetime". (See perl.h and intrpvar.h.)  If the size of time_t is
changed, all the members after the "basetime" are affected.

This is also related to 7.3.623.

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


# HG changeset patch
# Parent 966c7a71106199fdf3297c4f5d23be54b4051cea

diff --git a/src/if_perl.xs b/src/if_perl.xs
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -13,8 +13,22 @@
 #define _memory_h	/* avoid memset redeclaration */
 #define IN_PERL_FILE	/* don't include if_perl.pro from proto.h */
 
+/*
+ * Currently 32-bit version of ActivePerl is built with VC6.
+ * (http://community.activestate.com/faq/windows-compilers-perl-modules)
+ * It means that time_t should be 32-bit. However the default size of
+ * time_t is 64-bit since VC8. So we have to define _USE_32BIT_TIME_T.
+ */
+#if defined(WIN32) && !defined(_WIN64)
+# define _USE_32BIT_TIME_T
+#endif
+
 #include "vim.h"
 
+#include <EXTERN.h>
+#include <perl.h>
+#include <XSUB.h>
+
 
 /*
  * Work around clashes between Perl and Vim namespace.	proto.h doesn't
diff --git a/src/vim.h b/src/vim.h
--- a/src/vim.h
+++ b/src/vim.h
@@ -2195,10 +2195,6 @@
   /* Borland has the structure stati64 but not _stati64 */
 #  define _stati64 stati64
 # endif
-
-# include <EXTERN.h>
-# include <perl.h>
-# include <XSUB.h>
 #endif
 
 /* values for vim_handle_signal() that are not a signal */

Raspunde prin e-mail lui