Skip to content

Commit

Permalink
libpd_init now returns 0 on success & -1 on failure to match C conven…
Browse files Browse the repository at this point in the history
…tions; C# wrapper udpated to use libpd_init instead of libpd_safe_init
  • Loading branch information
danomatika committed Dec 19, 2013
1 parent e8a36eb commit d0daa83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion csharp/Native/LibPDNativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static void ReInit()
private static Dictionary<int, IntPtr> Patches = new Dictionary<int, IntPtr>();

/// Init PD
[DllImport("libpdcsharp.dll", EntryPoint="libpd_safe_init")]
[DllImport("libpdcsharp.dll", EntryPoint="libpd_init")]
private static extern void libpd_init() ;


Expand Down
4 changes: 2 additions & 2 deletions libpd_wrapper/z_libpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void *get_object(const char *s) {
/* this is called instead of sys_main() to start things */
int libpd_init(void) {
static int initialized = 0;
if (initialized) return 0; // only allow init once (for now)
if (initialized) return -1; // only allow init once (for now)
initialized = 1;
signal(SIGFPE, SIG_IGN);
libpd_start_message(32); // allocate array for message assembly
Expand All @@ -58,7 +58,7 @@ int libpd_init(void) {
sys_set_audio_api(API_DUMMY);
sys_searchpath = NULL;

return 1;
return 0;
}

void libpd_clear_search_path(void) {
Expand Down

0 comments on commit d0daa83

Please sign in to comment.