Menu

#251 Compiler macro needs to be fixed for macOS

new
None
normal
minor
Always
minor-fix
simpleFunctionObjects
2021-04-07
2021-04-07
No

A minor error in /Libraries/simpleFunctionObjects/functionObjectProxy/executeIfExecutableFitsFunctionObject/executeIfExecutableFitsFunctionObject.C
The compiler macro darwin is not working in macOS (I'm using 10.15 Catalina) and the code can't be compiled. __APPLE__ is the standard one.
The fixes are (I have tested)

#ifdef __APPLE__
#include "mach-o/dyld.h"
#endif

and

#ifdef __APPLE__
    {
        char path[1024];
        uint32_t size = sizeof(path);
        if (_NSGetExecutablePath(path, &size) == 0) {
            exePath=string(path);
        }
    }

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.