[Freeassociation-devel] 32 bit time_t
Antony Bowesman
adb at thorntothehorn.org
Thu Dec 29 15:52:21 PST 2011
On 30/12/2011 8:42 AM, Allen Winter wrote:
> On Thursday 29 December 2011 02:12:59 PM Antony Bowesman wrote:
>> I'm integrating libical with some old 32 bit s/w, which is built with
>> _USE_32BIT_TIME_T on Windows. This means any function with time_t in the
>> interface, e.g. icaltime_from_timet_with_zone() doesn't work using the default
>> libical build.
>>
>> I tried to run Cmake with -D_USE_32BIT_TIME_T=true, but it ignores that param.
>>
>> What's the 'right' way to make libical use 32 bit time_t? I modified the vcproj
>> files, but that's a hack.
>>
>> Is it modify cmakelists.txt or something else
>>
>> Can it be made configurable about whether Win version is built with 32/64 time_t?
>>
> So even if you are using a 32 bit MSVC, time_t is still 64 bits?
> that seems a little strange.
MS changed the default time_t size in Visual Studio 2005 from 32 to 64 bit, so
the default libical build using
cmake -G "Visual Studio 8 2005"
will make time_t 64 bit. Our app is built with -D_USE_32BIT_TIME_T, so the two
cannot work together unless I build libical with -D_USE_32BIT_TIME_T.
> try this: in the libical/CMakeLists.txt, put the line
> add_definitions(-D_USE_32BIT_TIME_T=1)
> somewhere near the top
That works, I wrapped it in
if(WIN32)
if(MSVC)
add_definitions(-D_USE_32BIT_TIME_T)
endif(MSVC)
endif(WIN32)
and it makes the vcproj files with the correct define, so that's OK, but I guess
some people will want 32 bit time_t and others will want 64, depends on how they
are using the library, so it would be good to have it selectable on the CMake
command line, e.g. with -D_USE_32BIT_TIME_T=true.
I'm not sure how to change CMakeLists.txt to achieve this though.
Thanks
Antony
>
> let me know
> -Allen
>
>
>
>
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Freeassociation-devel mailing list
> Freeassociation-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freeassociation-devel
More information about the libical-devel
mailing list