Skip to content

Commit

Permalink
pico_util: missing extern C in queue.h (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham committed Mar 15, 2021
1 parent de8beac commit 8b8611d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/common/pico_util/include/pico/util/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
* \ingroup pico_util
*/

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
spin_lock_t *lock;
uint8_t *data;
Expand Down Expand Up @@ -67,11 +71,11 @@ void queue_free(queue_t *q);
* spin lock is not externally locked
*/
static inline uint queue_get_level_unsafe(queue_t *q) {
int32_t rc = (int32_t)q->wptr - (int32_t)q->rptr;
int32_t rc = (int32_t) q->wptr - (int32_t) q->rptr;
if (rc < 0) {
rc += + q->element_count + 1;
rc += +q->element_count + 1;
}
return (uint)rc;
return (uint) rc;
}

/*! \brief Check of level of the specified queue.
Expand Down Expand Up @@ -181,4 +185,7 @@ void queue_remove_blocking(queue_t *q, void *data);
*/
void queue_peek_blocking(queue_t *q, void *data);

#ifdef __cplusplus
}
#endif
#endif

0 comments on commit 8b8611d

Please sign in to comment.