Changeset 12425


Ignore:
Timestamp:
Jul 17, 2009, 7:30:06 PM (10 years ago)
Author:
gb
Message:

define/use determine_executable_name() for windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r12269 r12425  
    10141014
    10151015#ifdef WINDOWS
     1016wchar_t *
     1017determine_executable_name()
     1018{
     1019  DWORD nsize = 512, result;
     1020  wchar_t *buf = malloc(nsize*sizeof(wchar_t));
     1021
     1022  do {
     1023    result = GetModuleFileNameW(NULL, buf, nsize);
     1024    if (result == nsize) {
     1025      nsize *= 2;
     1026      buf = realloc(buf,nsize*sizeof(wchar_t));
     1027    } else {
     1028      return buf;
     1029    }
     1030  } while (1);
     1031}
     1032
     1033
    10161034wchar_t *
    10171035ensure_real_path(wchar_t *path)
     
    16901708  check_os_version(argv[0]);
    16911709#ifdef WINDOWS
    1692   real_executable_name = utf_16_argv[0];
     1710  real_executable_name = determine_executable_name();
    16931711#else
    16941712  real_executable_name = determine_executable_name(argv[0]);
Note: See TracChangeset for help on using the changeset viewer.