Since <sys/param.h> isn't needed for __ELF__, pull in <stdio.h> for NULL
ok deraadt@
-#include <sys/param.h>
+#include <stdio.h>
#include <err.h>
#include <dlfcn.h>
-#ifdef __ELF__
-#define C_LABEL(x) x
-#else
-#define C_LABEL(x) "_" ## x
-#endif
-
int
-main()
+main(void)
{
void *handle = dlopen("libtest.so", DL_LAZY);
void (*version)(void);
if (handle == NULL)
errx(1, "could not dynamically link libtest");
- version = dlsym(handle, C_LABEL("version"));
+ version = dlsym(handle, "version");
if (version == NULL)
errx(2, "libtest did not define version()");
version();