Changeset 24020 for lang/c

Show
Ignore:
Timestamp:
11/18/08 06:02:45 (5 years ago)
Author:
saturday06
Message:

foo

Location:
lang/c/AutoUpdater
Files:
5 modified

Legend:

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

    r24019 r24020  
    1414  #define _T(text) text 
    1515#elif defined(__CYGWIN__) 
    16   #define _tcsdup strdup 
    1716  #define _T(text) TEXT(text) 
     17  #if defined(UNICODE) || defined(_UNICODE) 
     18 
     19#include <wchar.h> 
     20static 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 
     28    #define _tcsdup wcsdup 
     29  #else 
     30    #define _tcsdup strdup 
     31  #endif 
    1832#else 
    1933  #include <tchar.h> 
     34  #ifdef _MSC_VER 
     35    #pragma comment(lib, "wininet.lib") 
     36  #endif 
    2037#endif 
    2138 
     
    472489 
    473490    /* 
    474         Set ie = GetObject("new:{C08AFD90-F2A1-11D1-8455-00A0C91F3880}")        'IE7�ȍ~�� 
    475         ie.Navigate "c:\\zipfile.zip" 
    476         Do While ie.Busy Or ie.ReadyState<>4 
    477             WScript.Sleep 100 
    478         Loop 
    479         ie.Document.Application.NameSpace("c:\\destination_dir\\").CopyHere ie.Document.Folder.Items() 
     491    Set ie = GetObject("new:{C08AFD90-F2A1-11D1-8455-00A0C91F3880}") 
     492    ie.Navigate "c:\\zipfile.zip" 
     493    Do While ie.Busy Or ie.ReadyState<>4 
     494        WScript.Sleep 100 
     495    Loop 
     496    ie.Document.Application.NameSpace("c:\\destination_dir\\").CopyHere ie.Document.Folder.Items() 
    480497    */ 
    481498 
     
    502519    // --------------------------------------------- 
    503520    { 
     521        OLECHAR clsid_str_pool[] = OLESTR("{C08AFD90-F2A1-11D1-8455-00A0C91F3880}"); 
     522        LPOLESTR clsid_str = clsid_str_pool; 
    504523        CLSID clsid; 
    505         result = CLSIDFromString(OLESTR("{C08AFD90-F2A1-11D1-8455-00A0C91F3880}"), &clsid); 
     524 
     525        result = CLSIDFromString(clsid_str, &clsid); 
    506526         
    507527        switch (result) 
  • lang/c/AutoUpdater/AutoUpdater.h

    r23923 r24020  
    88#include <stddef.h> 
    99 
    10 #if (defined(WIN32) || defined(_WIN64) || defined(_WIN32_WCE)) && !defined(__CYGWIN__) 
     10#if (defined(WIN32) || defined(_WIN64) || defined(_WIN32_WCE) || defined(__CYGWIN__)) 
    1111  //#define _WIN32_IE    0x0550 // mlang.dll 
    1212  //#define _WIN32_WINNT 0x0400 
  • lang/c/AutoUpdater/Makefile.am

    r23921 r24020  
    2222test_CXXFLAGS = $(test_CFLAGS) -Weffc++ 
    2323test_LDFLAGS  =  
     24test_LDADD    =  
    2425 
     26if WITH_OS_WINDOWS 
     27test_CFLAGS  += -DUNICODE 
     28test_LDADD   += -lole32 -loleaut32 -luuid -lwininet 
     29endif 
    2530 
  • lang/c/AutoUpdater/Test.cpp

    r24019 r24020  
    1  
    2  
    31#include "AutoUpdater.h" 
    42 
     
    108#include <string> 
    119 
     10#ifdef AU_WINDOWS 
     11#define _T TEXT 
     12#else 
     13#define _T(str) str  
     14#endif 
     15 
    1216#define CURRENT_VERSION 200 
    13 #define SOURCE_URL "http://www.google.co.jp" 
     17#define SOURCE_URL _T("http://www.google.co.jp") 
    1418 
    1519char* get_random_data(size_t bytes) { 
     
    8993} 
    9094 
    91 extern "C" extern void ziptest(void); 
     95extern "C" { 
     96    extern void ziptest(void); 
     97} 
    9298 
    9399int main() { 
     
    98104        ziptest(); 
    99105    } 
    100  
    101     return 0; 
    102106 
    103107    assert(AU_CreateSource(NULL, CURRENT_VERSION, SOURCE_URL) == AU_ERROR_INVALID_SOURCE); 
     
    111115    { 
    112116        AU_Source* source; 
    113         assert(AU_CreateSource(&source, CURRENT_VERSION, "http://www.google.co.jp:12345/foo") == AU_OK); 
     117        assert(AU_CreateSource(&source, CURRENT_VERSION, _T("http://www.google.co.jp:12345/foo")) == AU_OK); 
    114118        assert(AU_ReleaseSource(source) == AU_OK); 
    115119    } 
  • lang/c/AutoUpdater/configure.ac

    r23918 r24020  
    1414AC_PROG_CXX 
    1515 
     16case `uname -s` in 
     17    MINGW*) 
     18        with_os=windows 
     19        ;; 
     20    CYGWIN*) 
     21        with_os=windows 
     22        with_cygwin=yes 
     23        ;; 
     24    *) 
     25        with_os=unix 
     26        ;; 
     27esac 
     28 
     29AM_CONDITIONAL(WITH_CYGWIN,     test "$with_cygwin" = "yes") 
     30AM_CONDITIONAL(WITH_OS_WINDOWS, test "$with_os"  = "windows") 
     31AM_CONDITIONAL(WITH_OS_UNIX,    test "$with_os"  = "unix") 
     32 
    1633# --------------------------------------- 
    1734# Checks for libraries.