Skip to content

Commit

Permalink
Unix: Shared libraries have a "lib" prefix
Browse files Browse the repository at this point in the history
When locating plugins, make sure the lookup is done using the
appropriate name.
  • Loading branch information
skyjake committed Oct 15, 2012
1 parent 9dbdc1e commit 52bba69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions doomsday/engine/api/dd_plugin.h
Expand Up @@ -40,6 +40,12 @@
*/
#define DENG_PLUGIN_GLOBAL(name) __DengPlugin_##name

#if defined(UNIX) && !defined(MACOSX)
# define DENG_AUDIO_PLUGIN_NAME_PREFIX "libaudio_"
#else
# define DENG_AUDIO_PLUGIN_NAME_PREFIX "audio_"
#endif

#define MAX_HOOKS 16
#define HOOKF_EXCLUSIVE 0x01000000

Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/audiodriver.c
Expand Up @@ -137,7 +137,7 @@ static int audioPluginFinder(const char* fileName, const char* absPath, void* pt

static AutoStr* findAudioPluginPath(const char* name)
{
AutoStr* path = Str_Appendf(AutoStr_New(), "audio_%s", name);
AutoStr* path = Str_Appendf(AutoStr_New(), "%s%s", DENG_AUDIO_PLUGIN_NAME_PREFIX, name);
if(Library_IterateAvailableLibraries(audioPluginFinder, path))
{
// The full path of the library was returned in @a path.
Expand Down
3 changes: 2 additions & 1 deletion doomsday/engine/portable/src/dd_plugin.c
Expand Up @@ -69,7 +69,8 @@ static int loadPlugin(const char* fileName, const char* pluginPath, void* param)
DENG_ASSERT(fileName && fileName[0]);
DENG_ASSERT(pluginPath && pluginPath[0]);

if(!strncmp(fileName, "audio_", 6))
if(!strncmp(fileName, DENG_AUDIO_PLUGIN_NAME_PREFIX,
strlen(DENG_AUDIO_PLUGIN_NAME_PREFIX)))
{
// The audio plugins are loaded later on demand by AudioDriver.
return false;
Expand Down

0 comments on commit 52bba69

Please sign in to comment.