Ken Takata wrote: > Hi Bram, > > 2016/6/23 Thu 18:30:16 UTC+9 Bram Moolenaar wrote: > > Oh, that is nasty. Compiling different files with different flags is > > possible with C and can cause these problems. > > > > I would suggest to find a way to compile the Perl code with 64 bit time_t, > > and maybe redefine time_t to a 32 bit type where needed. Not sure if this > > will be possible, since the code is generated. > > I tried this, but it didn't success. > > * Removed the definition of _USE_32BIT_TIME_T. > * Add "#define time_t int" before including perl.h. > * Add "#undef time_t" after including perl.h. > > This caused many compilation errors in system headers. Mixing 64- and 32-bit > time_t using redefinition in one C file seems impossible. > > I wrote another patch to fix this. This defines a new 64-bit type named > time_T. This type is used for global variables, global data types and global > functions. Now we can safely pass time data across different C files. > Local functions except in if_perl.xs can still use time_t safely, and also > they can use time_t and time_T as the same type. > Local functions only in if_perl.xs need to care about both time_t and time_T, > because they are different types.
Thanks, looks like a good solution. I'll add a comment to explain why we need to define time_T. -- All true wisdom is found on T-shirts. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
