- Timestamp:
- 11/18/08 06:02:45 (5 years ago)
- Location:
- lang/c/AutoUpdater
- Files:
-
- 5 modified
-
AutoUpdater.c (modified) (3 diffs)
-
AutoUpdater.h (modified) (1 diff)
-
Makefile.am (modified) (1 diff)
-
Test.cpp (modified) (5 diffs)
-
configure.ac (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/c/AutoUpdater/AutoUpdater.c
r24019 r24020 14 14 #define _T(text) text 15 15 #elif defined(__CYGWIN__) 16 #define _tcsdup strdup17 16 #define _T(text) TEXT(text) 17 #if defined(UNICODE) || defined(_UNICODE) 18 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 28 #define _tcsdup wcsdup 29 #else 30 #define _tcsdup strdup 31 #endif 18 32 #else 19 33 #include <tchar.h> 34 #ifdef _MSC_VER 35 #pragma comment(lib, "wininet.lib") 36 #endif 20 37 #endif 21 38 … … 472 489 473 490 /* 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<>4477 WScript.Sleep 100478 Loop479 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() 480 497 */ 481 498 … … 502 519 // --------------------------------------------- 503 520 { 521 OLECHAR clsid_str_pool[] = OLESTR("{C08AFD90-F2A1-11D1-8455-00A0C91F3880}"); 522 LPOLESTR clsid_str = clsid_str_pool; 504 523 CLSID clsid; 505 result = CLSIDFromString(OLESTR("{C08AFD90-F2A1-11D1-8455-00A0C91F3880}"), &clsid); 524 525 result = CLSIDFromString(clsid_str, &clsid); 506 526 507 527 switch (result) -
lang/c/AutoUpdater/AutoUpdater.h
r23923 r24020 8 8 #include <stddef.h> 9 9 10 #if (defined(WIN32) || defined(_WIN64) || defined(_WIN32_WCE) ) && !defined(__CYGWIN__)10 #if (defined(WIN32) || defined(_WIN64) || defined(_WIN32_WCE) || defined(__CYGWIN__)) 11 11 //#define _WIN32_IE 0x0550 // mlang.dll 12 12 //#define _WIN32_WINNT 0x0400 -
lang/c/AutoUpdater/Makefile.am
r23921 r24020 22 22 test_CXXFLAGS = $(test_CFLAGS) -Weffc++ 23 23 test_LDFLAGS = 24 test_LDADD = 24 25 26 if WITH_OS_WINDOWS 27 test_CFLAGS += -DUNICODE 28 test_LDADD += -lole32 -loleaut32 -luuid -lwininet 29 endif 25 30 -
lang/c/AutoUpdater/Test.cpp
r24019 r24020 1 2 3 1 #include "AutoUpdater.h" 4 2 … … 10 8 #include <string> 11 9 10 #ifdef AU_WINDOWS 11 #define _T TEXT 12 #else 13 #define _T(str) str 14 #endif 15 12 16 #define CURRENT_VERSION 200 13 #define SOURCE_URL "http://www.google.co.jp"17 #define SOURCE_URL _T("http://www.google.co.jp") 14 18 15 19 char* get_random_data(size_t bytes) { … … 89 93 } 90 94 91 extern "C" extern void ziptest(void); 95 extern "C" { 96 extern void ziptest(void); 97 } 92 98 93 99 int main() { … … 98 104 ziptest(); 99 105 } 100 101 return 0;102 106 103 107 assert(AU_CreateSource(NULL, CURRENT_VERSION, SOURCE_URL) == AU_ERROR_INVALID_SOURCE); … … 111 115 { 112 116 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); 114 118 assert(AU_ReleaseSource(source) == AU_OK); 115 119 } -
lang/c/AutoUpdater/configure.ac
r23918 r24020 14 14 AC_PROG_CXX 15 15 16 case `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 ;; 27 esac 28 29 AM_CONDITIONAL(WITH_CYGWIN, test "$with_cygwin" = "yes") 30 AM_CONDITIONAL(WITH_OS_WINDOWS, test "$with_os" = "windows") 31 AM_CONDITIONAL(WITH_OS_UNIX, test "$with_os" = "unix") 32 16 33 # --------------------------------------- 17 34 # Checks for libraries.
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)