comparison runtime/internal/dmain2.d @ 646:51c4d1a64da6

Portability changes to dmain2.d
author Christian Kamm <kamm incasoftware de>
date Sat, 04 Oct 2008 23:28:49 +0200
parents bb8d73e29324
children 8208374e5bed
comparison
equal deleted inserted replaced
645:bb8d73e29324 646:51c4d1a64da6
174 _STI_monitor_staticctor(); 174 _STI_monitor_staticctor();
175 _STI_critical_init(); 175 _STI_critical_init();
176 initStaticDataPtrs(); 176 initStaticDataPtrs();
177 177
178 debug(PRINTF) printf("main args\n"); 178 debug(PRINTF) printf("main args\n");
179 // GDC seems to get by without this Windows special case...
179 version (Win32) 180 version (Win32)
180 { 181 {
181 wchar_t* wcbuf = GetCommandLineW(); 182 wchar_t* wcbuf = GetCommandLineW();
182 size_t wclen = wcslen(wcbuf); 183 size_t wclen = wcslen(wcbuf);
183 int wargc = 0; 184 int wargc = 0;
200 } 201 }
201 LocalFree(wargs); 202 LocalFree(wargs);
202 wargs = null; 203 wargs = null;
203 wargc = 0; 204 wargc = 0;
204 } 205 }
205 else version (linux) 206 else
206 { 207 {
207 char[]* am = cast(char[]*) malloc(argc * (char[]).sizeof); 208 char[]* am = cast(char[]*) malloc(argc * (char[]).sizeof);
208 scope(exit) free(am); 209 scope(exit) free(am);
209 210
210 for (size_t i = 0; i < argc; i++) 211 for (size_t i = 0; i < argc; i++)