Changeset 29922 for lang/c

Show
Ignore:
Timestamp:
02/11/09 21:52:23 (4 years ago)
Author:
saturday06
Message:

mo

Location:
lang/c/AutoUpdater
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/c/AutoUpdater/AutoUpdater.c

    r25995 r29922  
    99#include <time.h> 
    1010 
    11 #ifndef AU_WINDOWS 
    12   #define TCHAR char 
    13   #define _tcsdup strdup 
    14   #define _T(text) text 
     11#if !defined(AU_WINDOWS) 
     12 
     13  #ifndef _TCHAR_DEFINED 
     14    typedef TCHAR char; 
     15    #define _tcsdup strdup 
     16  #endif 
     17 
     18  #ifndef _T 
     19    #define _T(x) x 
     20  #endif 
     21 
     22#elif defined(__CYGWIN__) 
     23 
     24  #ifndef _TCHAR_DEFINED 
     25    #if defined(UNICODE) || defined(_UNICODE) 
     26    typedef TCHAR WCHAR; 
     27    #else 
     28    typedef TCHAR CHAR; 
     29    #endif 
     30  #endif 
     31 
     32  #if defined(UNICODE) || defined(_UNICODE) 
     33    #include <wchar.h> 
     34    static wchar_t *wcsdup(const wchar_t *s) { 
     35        size_t len; 
     36        len = wcslen(s) + 1; 
     37        wchar_t* buf = malloc(len * sizeof(wchar_t)); 
     38        memcpy(buf, s, len * sizeof(wchar_t)); 
     39        return buf; 
     40    } 
     41    #define _tcsdup wcsdup 
     42  #else 
     43    #define _tcsdup strdup 
     44  #endif 
     45 
     46  #ifndef _T 
     47    #define _T(text) TEXT(text) 
     48  #endif 
    1549#else 
    16   #ifdef __CYGWIN__ 
    17     #define _T(text) TEXT(text) 
    18     #if defined(UNICODE) || defined(_UNICODE) 
    19       #include <wchar.h> 
    20       static wchar_t *wcsdup(const wchar_t *s) { 
    21           size_t len; 
    22           len = wcslen(s) + 1; 
    23           wchar_t* buf = malloc(len * sizeof(wchar_t)); 
    24           memcpy(buf, s, len * sizeof(wchar_t)); 
    25           return buf; 
    26       } 
    27       #define _tcsdup wcsdup 
    28     #else 
    29       #define _tcsdup strdup 
    30     #endif 
    31   #else 
    32     #include <tchar.h> 
    33     #ifdef _MSC_VER 
    34       #pragma comment(lib, "wininet.lib") 
    35     #endif 
    36     static unsigned int sleep(unsigned int seconds) { 
    37         Sleep(1000 * seconds); 
    38         return 0; 
    39     } 
     50 
     51  #include <tchar.h> 
     52  #ifdef _MSC_VER 
     53    #pragma comment(lib, "wininet.lib") 
    4054  #endif 
     55  static unsigned int sleep(unsigned int seconds) { 
     56      Sleep(1000 * seconds); 
     57      return 0; 
     58  } 
     59 
    4160#endif 
    4261 
  • lang/c/AutoUpdater/AutoUpdater.h

    r25995 r29922  
    5959typedef struct { 
    6060    char created_sign; 
    61     const AU_Option option; 
     61    AU_Option option; 
    6262 
    6363    AU_CHAR_* description;