diff options
author | David Robillard <d@drobilla.net> | 2012-08-03 16:43:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-03 16:43:57 +0000 |
commit | 769d980f5ef68b84b8a4fe016eccced4d3b06b49 (patch) | |
tree | e697e4aa125a1fbfae858f5ae681721305cb8ae4 /src | |
parent | 6d856f2c3207fd5acd513d41f72830c29daf07f2 (diff) | |
download | suil-769d980f5ef68b84b8a4fe016eccced4d3b06b49.tar.gz suil-769d980f5ef68b84b8a4fe016eccced4d3b06b49.tar.bz2 suil-769d980f5ef68b84b8a4fe016eccced4d3b06b49.zip |
Fix compilation with MSVC.
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4609 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/host.c | 2 | ||||
-rw-r--r-- | src/instance.c | 4 | ||||
-rw-r--r-- | src/suil_internal.h | 7 |
3 files changed, 7 insertions, 6 deletions
@@ -23,7 +23,7 @@ suil_host_new(SuilPortWriteFunc write_func, SuilPortSubscribeFunc subscribe_func, SuilPortUnsubscribeFunc unsubscribe_func) { - SuilHost* host = malloc(sizeof(struct SuilHostImpl)); + SuilHost* host = (SuilHost*)malloc(sizeof(struct SuilHostImpl)); host->write_func = write_func; host->index_func = index_func; host->subscribe_func = subscribe_func; diff --git a/src/instance.c b/src/instance.c index 0f9434a..617280e 100644 --- a/src/instance.c +++ b/src/instance.c @@ -98,7 +98,7 @@ open_wrapper(SuilHost* host, + strlen(module_name) + 2; - char* const path = calloc(path_len, 1); + char* const path = (char*)calloc(path_len, 1); snprintf(path, path_len, "%s%s%s%s%s", mod_dir, SUIL_DIR_SEP, SUIL_MODULE_PREFIX, module_name, SUIL_MODULE_EXT); @@ -184,7 +184,7 @@ suil_instance_new(SuilHost* host, } // Create SuilInstance - SuilInstance* instance = calloc(1, sizeof(struct SuilInstanceImpl)); + SuilInstance* instance = (SuilInstance*)calloc(1, sizeof(SuilInstance)); if (!instance) { SUIL_ERRORF("Failed to allocate memory for <%s> instance\n", ui_uri); dlclose(lib); diff --git a/src/suil_internal.h b/src/suil_internal.h index 385dc26..0e565cb 100644 --- a/src/suil_internal.h +++ b/src/suil_internal.h @@ -24,8 +24,10 @@ #ifdef _WIN32 #include <windows.h> #define dlopen(path, flags) LoadLibrary(path) -#define dlclose(lib) FreeLibrary(lib) +#define dlclose(lib) FreeLibrary((HMODULE)lib) #define dlsym GetProcAddress +#define inline __inline +#define snprintf _snprintf static inline char* dlerror(void) { return "Unknown error"; } #else #include <dlfcn.h> @@ -35,8 +37,7 @@ static inline char* dlerror(void) { return "Unknown error"; } #include "suil/suil.h" -#define SUIL_ERRORF(fmt, ...) fprintf(stderr, "error: %s: " fmt, \ - __func__, __VA_ARGS__) +#define SUIL_ERRORF(fmt, ...) fprintf(stderr, "suil error: " fmt, __VA_ARGS__) struct SuilHostImpl { SuilPortWriteFunc write_func; |