fixes for WIN32

This commit is contained in:
U-WIN-U2045GN0RNQ\Vítor Santos Costa 2010-07-20 13:42:35 +01:00
parent f9ed9961df
commit b9e63fa4b9
3 changed files with 18 additions and 4 deletions

2
packages/tai/Makefile.in Normal file → Executable file
View File

@ -48,7 +48,7 @@ pl-tai.o: $(srcdir)/pl-tai.c
$(CC) -c $(CFLAGS) $(srcdir)/pl-tai.c -o pl-tai.o
@DO_SECOND_LD@pl-tai.@SO@: pl-tai.o
@DO_SECOND_LD@ @SHLIB_LD@ -o pl-tai.@SO@ pl-tai.o libtai/libtai.a @EXTRA_LIBS_FOR_DLLS@
@DO_SECOND_LD@ @SHLIB_LD@ -o pl-tai.@SO@ pl-tai.o libtai/libtai.a @EXTRA_LIBS_FOR_SWIDLLS@
install: all
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)

2
packages/tai/libtai/tai.h Normal file → Executable file
View File

@ -8,7 +8,7 @@ typedef unsigned __int64 uint64_t;
#include <inttypes.h> /* more portable than stdint.h */
#endif
#ifdef __WINDOWS__
#if defined(__WINDOWS__) && !defined(__GNUC__)
#define LL(x) x ## i64
#define ULL(x) x ## ui64
#else

18
packages/tai/pl-tai.c Normal file → Executable file
View File

@ -38,9 +38,23 @@ is supposed to give the POSIX standard one.
#include <stdio.h>
#include <ctype.h>
#if defined(__WINDOWS__) || defined (__CYGWIN__)
#if defined(__WINDOWS__) || defined (__CYGWIN__) || defined (__MINGW32__)
#define timezone _timezone
#define HAVE_VAR_TIMEZONE
#ifndef _POSIX
#endif
#define localtime_r(_Time, _Tm) ({ struct tm *___tmp_tm = \
localtime((_Time)); \
if (___tmp_tm) { \
*(_Tm) = *___tmp_tm; \
___tmp_tm = (_Tm); \
} \
___tmp_tm; })
#define asctime_r(_Tm, _Buf) ({ char *___tmp_tm = asctime((_Tm)); \
if (___tmp_tm) \
___tmp_tm = \
strcpy((_Buf),___tmp_tm);\
___tmp_tm; })
#include <time.h>
#else
extern char *tzname[2];
#ifdef HAVE_VAR_TIMEZONE