[svn-commits] rizzo: branch rizzo/cygwin_build r88469 - /team/rizzo/cygwin_build/main/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Sun Nov 4 15:27:33 CST 2007
Author: rizzo
Date: Sun Nov 4 15:27:33 2007
New Revision: 88469
URL: http://svn.digium.com/view/asterisk?view=rev&rev=88469
Log:
add trivial file to load the library.
Added:
team/rizzo/cygwin_build/main/cygload.c (with props)
Added: team/rizzo/cygwin_build/main/cygload.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/cygwin_build/main/cygload.c?view=auto&rev=88469
==============================================================================
--- team/rizzo/cygwin_build/main/cygload.c (added)
+++ team/rizzo/cygwin_build/main/cygload.c Sun Nov 4 15:27:33 2007
@@ -1,0 +1,20 @@
+/*
+ * Loader for asterisk under windows.
+ * Open the dll, locate main, run.
+ */
+#include <unistd.h>
+#include <dlfcn.h>
+#include <stdio.h>
+
+typedef int (*main_f)(int argc, char *argv[]);
+
+int main(int argc, char *argv[])
+{
+ int (*ast_main)(int argc, char *argv[]) = NULL;
+ void *handle = dlopen("asterisk.dll", 0);
+ if (handle)
+ ast_main = (main_f)dlsym(handle, "amain");
+ if (ast_main)
+ return ast_main(argc, argv);
+ fprintf(stderr, "could not load asterisk, %s\n", dlerror());
+}
Propchange: team/rizzo/cygwin_build/main/cygload.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/rizzo/cygwin_build/main/cygload.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/rizzo/cygwin_build/main/cygload.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the svn-commits
mailing list