From 2ca0cdf979f9d9c337c5cbc7a484229b8028ada5 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 17 Jun 2017 03:15:35 +0200 Subject: [PATCH] fix undefined reference caused by inlined function --- include/villas/shmem.h | 11 ++++------- lib/shmem.c | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/villas/shmem.h b/include/villas/shmem.h index 0171402d1..f60659e60 100644 --- a/include/villas/shmem.h +++ b/include/villas/shmem.h @@ -119,18 +119,15 @@ int shmem_int_read(struct shmem_int *shm, struct sample *smps[], unsigned cnt); */ int shmem_int_write(struct shmem_int *shm, struct sample *smps[], unsigned cnt); -/** Allocate samples to be written to the interface. The writing process must +/** Allocate samples to be written to the interface. * - * not free the samples; only the receiving process should free them using - * sample_put after use. + * The writing process must not free the samples; only the receiving process should free them using sample_put after use. * @param shm The shared memory interface. * @param smps Array where pointers to newly allocated samples will be returned. * @param cnt Number of samples to allocate. - * @returns Number of samples that were successfully allocated (may be less then cnt). + * @return Number of samples that were successfully allocated (may be less then cnt). */ -inline int shmem_int_alloc(struct shmem_int *shm, struct sample *smps[], unsigned cnt) { - return sample_alloc(&shm->write.shared->pool, smps, cnt); -} +int shmem_int_alloc(struct shmem_int *shm, struct sample *smps[], unsigned cnt); /** Returns the total size of the shared memory region with the given size of * the input/output queues (in elements) and the given number of data elements diff --git a/lib/shmem.c b/lib/shmem.c index fe9b5c8ab..df33d40a0 100644 --- a/lib/shmem.c +++ b/lib/shmem.c @@ -169,3 +169,8 @@ int shmem_int_write(struct shmem_int *shm, struct sample *smps[], unsigned cnt) return shm->write.shared->polling ? queue_push_many(&shm->write.shared->queue.q, (void **) smps, cnt) : queue_signalled_push_many(&shm->write.shared->queue.qs, (void **) smps, cnt); } + +int shmem_int_alloc(struct shmem_int *shm, struct sample *smps[], unsigned cnt) +{ + return sample_alloc(&shm->write.shared->pool, smps, cnt); +}