Hello Terrence,

I do not think it is possible to set an environment variable to an empty
string on Windows. This amounts to undefining it.

I have found the same problem with setenv() and unsetenv() on my
venerable platform (Windows XP, 32 bits, with MSVC 6.0). I will create
a workaround using putenv(), because right now building PLplot stops
on the QSAS test program.

Regards,

Arjen

On 2009-02-14 17:05, trc wrote:
> Hi Alan,
> 
> Alan W. Irwin wrote:
>>> [out of order] 4. qsastime_testlib cannot be built with MSVC 2008 as 
>>> setenv and unsetenv
>>>    are not implemented.
>>>
>>> [so] the above changes
>>> are untested.
>> Is this a showstopper for MSVC 2008 or do you think you can find for that
>> platform (a) some library alternatives for setenv and unsetenv, (b) some
>> other alternative to set the time zone to zero temporarily which would make
>> mktime act like an inverse to gmtime, or (c) some other alternative that is
>> equivalent to the Linux timegm or the inverse of gmtime?
>>
> 
> 
> There are too many problems to make qsastime_testlib worthwhile on 32 bit 
> Windows XP with MSVC 2008 (and earlier editions) even with 64 bit time_t 
> values.
> 
> 32 bit Windows XP / MSVC 2008 has extensions for 64 bit time_t values and a 
> function  _mkgmtime64 for converting times a struct tm to 64 bit time_t. 
> Unfortunately mkgmtime64 returns -1 for all times prior to 1/1/1970.
> 
> A further problem for qsastime_testlib is that the MSVC debug version of 
> strftime throws an exception for years less than 0 or greater than 9999. 
> 
> For the record MSVC has the (unix) putenv function which can be used to 
> implement setenv and unsetenv. However googling putenv suggests there could 
> be problems with memory leaks and care has to be taken over 
> ownership/lifetime of the environment variables. Further it is unclear how an 
> environment variable is set to empty string. eg. 
>    setenv("TZ","",1) -> putenv("TZ=")
> This unsets TZ rather than setting it to an empty string.
>  
> 
> Default 32 bit Cygwin compiles and links but has 32 bit time_t so testing is 
> not done. I didn't investigate if there were 64bit time_t extensions.
> 
> Note my investigations were on a 32bit Windows XP system so this excludes 32 
> bit Vista and 64bit versions of XP and Vista.
> 
> 
> Terrence
> 
> 
> 
>       
> 
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Plplot-devel mailing list
> Plplot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-devel
> 


Delft Hydraulics, GeoDelft, the Subsurface and Groundwater unit of TNO and 
parts of Rijkswaterstaat have joined forces in a new independent institute for 
delta technology, Deltares. Deltares combines knowledge and experience in the 
field of water, soil and the subsurface. We provide innovative solutions to 
make living in deltas, coastal areas and river basins safe, clean and 
sustainable. 

 

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.





------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to