Commit 400a51c5 authored by sletz's avatar sletz
Browse files

Compiles on Windows again.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3860 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 6ec1cee8
......@@ -145,11 +145,11 @@ static int semid = -1;
#ifdef WIN32
static void
semaphore_init () {}
static int
semaphore_init () {return 0;}
static void
semaphore_add (int value) {}
static int
semaphore_add (int value) {return 0;}
#else
/* all semaphore errors are fatal -- issue message, but do not return */
......@@ -194,7 +194,7 @@ semaphore_init ()
return -1;
}
}
return 0;
}
......@@ -206,12 +206,12 @@ semaphore_add (int value)
sbuf.sem_num = 0;
sbuf.sem_op = value;
sbuf.sem_flg = SEM_UNDO;
if (semop(semid, &sbuf, 1) == -1) {
semaphore_error ("semop");
return -1;
}
return 0;
}
......@@ -228,7 +228,7 @@ jack_shm_lock_registry (void)
return semaphore_add (-1);
}
static void
static void
jack_shm_unlock_registry (void)
{
semaphore_add (1);
......@@ -370,7 +370,7 @@ jack_initialize_shm (const char *server_name)
jack_error ("jack_shm_lock_registry fails...");
return -1;
}
if ((rc = jack_access_registry (&registry_info)) == 0) {
if ((rc = jack_shm_validate_registry ()) != 0) {
jack_error ("Incompatible shm registry, "
......@@ -441,7 +441,7 @@ jack_release_shm_info (jack_shm_registry_index_t index)
jack_release_shm_entry (index);
jack_shm_unlock_registry ();
}
return 0;
}
......@@ -518,7 +518,7 @@ jack_register_server (const char *server_name, int new_registry)
}
/* release server_name registration */
void
int
jack_unregister_server (const char *server_name /* unused */)
{
int i;
......@@ -534,7 +534,8 @@ jack_unregister_server (const char *server_name /* unused */)
}
}
jack_shm_unlock_registry ();
jack_shm_unlock_registry ();
return 0;
}
/* called for server startup and termination */
......
......@@ -115,33 +115,33 @@ extern "C"
* indicating where the shared memory has been
* attached to the address space.
*/
typedef struct _jack_shm_info {
jack_shm_registry_index_t index; /* offset into the registry */
uint32_t size;
union {
void *attached_at; /* address where attached */
char ptr_size[8];
} ptr; /* a "pointer" that has the same 8 bytes size when compling in 32 or 64 bits */
char ptr_size[8];
} ptr; /* a "pointer" that has the same 8 bytes size when compling in 32 or 64 bits */
}
POST_PACKED_STRUCTURE jack_shm_info_t;
/* utility functions used only within JACK */
void jack_shm_copy_from_registry (jack_shm_info_t*,
jack_shm_registry_index_t);
void jack_shm_copy_to_registry (jack_shm_info_t*,
jack_shm_registry_index_t*);
int jack_release_shm_info (jack_shm_registry_index_t);
char* jack_shm_addr (jack_shm_info_t* si);
char* jack_shm_addr (jack_shm_info_t* si);
// here begin the API
// here begin the API
int jack_register_server (const char *server_name, int new_registry);
void jack_unregister_server (const char *server_name);
int jack_unregister_server (const char *server_name);
int jack_initialize_shm (const char *server_name);
int jack_initialize_shm_server (void);
int jack_initialize_shm_client (void);
int jack_initialize_shm_server (void);
int jack_initialize_shm_client (void);
int jack_cleanup_shm (void);
int jack_shmalloc (const char *shm_name, jack_shmsize_t size,
......@@ -149,7 +149,7 @@ extern "C"
void jack_release_shm (jack_shm_info_t*);
void jack_destroy_shm (jack_shm_info_t*);
int jack_attach_shm (jack_shm_info_t*);
int jack_attach_shm_read (jack_shm_info_t*);
int jack_attach_shm_read (jack_shm_info_t*);
int jack_resize_shm (jack_shm_info_t*, jack_shmsize_t size);
#ifdef __cplusplus
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment