Robin Mills 7 years ago committed by Luis Díaz Más
parent b944b2ace7
commit 22e49cc78b

@ -199,6 +199,8 @@ if (NOT MSVC)
endif() endif()
target_link_libraries( exiv2lib PRIVATE Threads::Threads) target_link_libraries( exiv2lib PRIVATE Threads::Threads)
else()
target_link_libraries( exiv2lib PRIVATE psapi ws2_32 )
endif() endif()
if( EXIV2_ENABLE_PNG ) if( EXIV2_ENABLE_PNG )

@ -464,15 +464,9 @@ namespace Exiv2 {
{ {
std::string ret("unknown"); std::string ret("unknown");
#if defined(WIN32) #if defined(WIN32)
HANDLE processHandle = NULL; if ( GetModuleFileName( "", filename, MAX_PATH ) != 0 ) {
processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, GetCurrentProcessId());
if (processHandle != NULL) {
TCHAR filename[MAX_PATH];
if (GetModuleFileNameEx(processHandle, NULL, filename, MAX_PATH) != 0) {
ret = filename; ret = filename;
} }
CloseHandle(processHandle);
}
#elif defined(__APPLE__) #elif defined(__APPLE__)
const int pid = getpid(); const int pid = getpid();
char pathbuf[PROC_PIDPATHINFO_MAXSIZE]; char pathbuf[PROC_PIDPATHINFO_MAXSIZE];

Loading…
Cancel
Save