Lock free MPMC Ring buffer implementation in C
Did you test it?  

I think you have a problem if a thread calls enqueue and is interrupted
just before the memcpy, having calculated pos to be slot-1.  If another
thread now calls enqueue and completes it will write to slot-2 and increment the pendingRead counter, leaving
slot-1 still unwritten.  If a third thread now reads before the first thread
can complete its write, the reader will read from the unwritten slot-1.  This
is becase the second thread correctly set the queue to say there is a pending
read (slot-2) but dequeue assumes the data must be in the next available
slot according to readPos. 

A few other comments:


queue_t is defined (elsewhere) as a pointer type. I prefer pointers to be
explicit.
You have mixed use of struct queue * and queue_t
Return from malloc is not checked.
buf in struct queue should be void* not char **
Why are writePos and readPos of type uint64_t and not size_t?
After all, num is size_t.  Why the difference?
Loss of precision assigning num in createQueue