Changeset 14205


Ignore:
Timestamp:
Aug 24, 2010, 1:06:47 AM (9 years ago)
Author:
rme
Message:

Do #include <mach-o/dyld.h> on Darwin to get prototype for
_NSGetExecutablePath(). The #undef undefined is needed to
protect against a conflict in <cpu>-constants.h

File:
1 edited

Legend:

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

    r14197 r14205  
    1616*/
    1717
    18 #ifdef DARWIN
    19 /*      dyld.h included here because something in "lisp.h" causes
    20     a conflict (actually I think the problem is in "constants.h")
    21 */
    22 /* #include <mach-o/dyld.h> */
    23 
    24 #endif
    2518#include "lisp.h"
    2619#include "lisp_globals.h"
     
    9184#include <mach/port.h>
    9285#include <sys/sysctl.h>
     86#undef undefined
     87#include <mach-o/dyld.h>
    9388#include <dlfcn.h>
    9489#endif
     
    981976  uint32_t len = 1024;
    982977  char exepath[1024], *p = NULL;
    983 
    984   if (_NSGetExecutablePath(exepath, (void *)&len) == 0) {
     978   
     979  if (_NSGetExecutablePath(exepath, &len) == 0) {
    985980    p = malloc(len+1);
    986981    memmove(p, exepath, len);
Note: See TracChangeset for help on using the changeset viewer.