#include "gnunet_configuration_lib.h"
#include "gnunet_disk_lib.h"
#include "gnunet_os_lib.h"
-#if OSX
+#if DARWIN
#include <mach-o/ldsyms.h>
#include <mach-o/dyld.h>
#endif
}
#endif
-#if OSX
+#if DARWIN
typedef int (*MyNSGetExecutablePathProto) (char *buf, size_t * bufsize);
static char *
char *end;
char *buf;
const char *p;
- size_t size;
p = getenv ("PATH");
if (p == NULL)
return NULL;
path = GNUNET_strdup (p); /* because we write on it */
buf = GNUNET_malloc (strlen (path) + 20);
- size = strlen (path);
pos = path;
while (NULL != (end = strchr (pos, ':')))
if (ret != NULL)
return ret;
#endif
-#if OSX
+#if DARWIN
ret = get_path_from_dyld_image ();
if (ret != NULL)
return ret;
return ret;
/* other attempts here */
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Could not determine installation path for GNUnet. Set `%s' environment variable.\n"),
- "GNUNET_PREFIX");
+ _
+ ("Could not determine installation path for GNUnet. Set `%s' environment variable.\n"),
+ "GNUNET_PREFIX");
return NULL;
}
{
char *ret;
+ ret = NULL;
#if LINUX
ret = get_path_from_proc_exe ();
if (ret != NULL)
if (ret != NULL)
return ret;
#endif
-#if OSX
+#if DARWIN
ret = get_path_from_NSGetExecutablePath ();
if (ret != NULL)
return ret;
#endif
/* other attempts here */
- return NULL;
+ return ret;
}
#ifdef __cplusplus
}
#endif
-/* end of installpath.c */
+/* end of os_installation.c */