Explicitly test for libproc.h (#1916)

This change adds support for ancient macOS lacking libproc. It also
eliminates a bug where exiv2 could not be built on case-sensitive
file systems (the header file is properly TargetConditionals.h).
This commit is contained in:
Evan Miller
2021-09-20 08:42:40 -04:00
committed by GitHub
parent 66b40d8823
commit 04f4624718
3 changed files with 6 additions and 3 deletions
+2 -3
View File
@@ -48,8 +48,7 @@
#if defined(_MSC_VER)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#elif defined(__APPLE__)
#include <Targetconditionals.h>
#ifndef TARGET_OS_IPHONE
#if defined(EXV_HAVE_LIBPROC_H)
#include <libproc.h>
#endif
#endif
@@ -458,7 +457,7 @@ namespace Exiv2 {
CloseHandle(processHandle);
}
#elif defined(__APPLE__)
#ifndef TARGET_OS_IPHONE
#ifdef EXV_HAVE_LIBPROC_H
const int pid = getpid();
char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
if (proc_pidpath (pid, pathbuf, sizeof(pathbuf)) > 0) {