Skip to content

Commit

Permalink
Remove obsoleted Mac OS X Server compatibility code in module.c
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark authored Nov 30, 2024
1 parent e8e567a commit 22fa644
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions libatalk/util/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,7 @@

#include <atalk/util.h>

#ifndef HAVE_DLFCN_H
#ifdef MACOSX_SERVER
#include <mach-o/dyld.h>

void *mod_open(const char *path)
{
NSObjectFileImage file;

if (NSCreateObjectFileImageFromFile(path, &file) !=
NSObjectFileImageSuccess)
return NULL;
return NSLinkModule(file, path, TRUE);
}

void *mod_symbol(void *module, const char *name)
{
NSSymbol symbol;
char *underscore;

if ((underscore = (char *) malloc(strlen(name) + 2)) == NULL)
return NULL;
strcpy(underscore, "_");
strcat(underscore, name);
symbol = NSLookupAndBindSymbol(underscore);
free(underscore);

return NSAddressOfSymbol(symbol);
}

void mod_close(void *module)
{
NSUnLinkModule(module, FALSE);
}
#endif /* MACOSX_SERVER */

#else /* HAVE_DLFCN_H */
#ifdef HAVE_DLFCN_H

#include <dlfcn.h>

Expand Down

0 comments on commit 22fa644

Please sign in to comment.