cmake HAVE_DYLD_RETURN_ON_ERROR examples

JulNadeauCA/libagar CMakeChecks.cmake :1165

check_c_source_compiles("
#ifdef HAVE_MACH_O_DYLD_H
#include <mach-o/dyld.h>
#endif
int
main(int argc, char *argv[])
{
	NSObjectFileImage img;
	NSObjectFileImageReturnCode rv;
	void *handle;

	rv = NSCreateObjectFileImageFromFile(\"foo\", &img);
	handle = (void *)NSLinkModule(img, \"foo\",
	    NSLINKMODULE_OPTION_RETURN_ON_ERROR|
		NSLINKMODULE_OPTION_NONE);
	if (handle == NULL) {
		NSLinkEditErrors errs;
		int n;
		const char *f, *s = NULL;
		NSLinkEditError(&errs, &n, &f, &s);
	}
	return (0);
}
" HAVE_DYLD_RETURN_ON_ERROR)