source: trunk/dports/games/xracer/files/patch-craft.c @ 1417

Last change on this file since 1417 was 1417, checked in by jkh, 18 years ago

More dylib fix-ups.

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1--- src/craft.c.orig    Thu Dec 12 15:03:41 2002
2+++ src/craft.c Thu Dec 12 15:05:31 2002
3@@ -85,12 +85,12 @@
4       /* xrLog (LOG_DEBUG, "name = %s (len = %d)", name, len); */
5 
6       if (strncmp (name, "libcraft", 8) == 0 &&
7-         strcmp (name + len - 3, ".so") == 0)
8+         strcmp (name + len - 6, ".dylib") == 0)
9        {
10          char shortname[1024];
11 
12-         strncpy (shortname, name + 8, len - 11);
13-         shortname[len-11] = '\0';
14+         strncpy (shortname, name + 8, len - 14);
15+         shortname[len-14] = '\0';
16 
17          /* Try loading it. Don't worry about the return value. */
18          xrCraftLoadByName (shortname);
19@@ -115,7 +115,7 @@
20   struct xrCraft *craft;
21 
22   /* Try to construct the name of the shared library containing this craft. */
23-  snprintf (filename, sizeof filename, "craft/libcraft%s.so", name);
24+  snprintf (filename, sizeof filename, "craft/libcraft%s.dylib", name);
25 
26   /* See if we can open this track. Make sure we resolve all link-time
27    * errors now, and make sure that symbols from the track don't pollute
28@@ -130,7 +130,7 @@
29     }
30 
31   /* The shared library contains one symbol of interest: ``craft'' */
32-  craft_struct = dlsym (lib, "craft");
33+  craft_struct = dlsym (lib, "_craft");
34 
35   /* This is OK. This symbol should never actually be NULL. */
36   if (craft_struct == NULL)
Note: See TracBrowser for help on using the repository browser.