Explorar o código

queue.h: Replace #ifdef COROSYNC_SOLARIS...

* include/corosync/queue.h: Remove #ifdef COROSYNC_SOLARIS
in favor of agnostic "#ifdef queue".

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2010 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering %!s(int64=17) %!d(string=hai) anos
pai
achega
2331454b2b
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      include/corosync/queue.h

+ 5 - 4
include/corosync/queue.h

@@ -6,7 +6,7 @@
  * Author: Steven Dake (sdake@redhat.com)
  * Author: Steven Dake (sdake@redhat.com)
  *
  *
  * This software licensed under BSD license, the text of which follows:
  * This software licensed under BSD license, the text of which follows:
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  * modification, are permitted provided that the following conditions are met:
  *
  *
@@ -38,8 +38,9 @@
 #include <pthread.h>
 #include <pthread.h>
 #include "assert.h"
 #include "assert.h"
 
 
-#ifdef COROSYNC_SOLARIS
+#ifdef queue
 /* struct queue is already defined in sys/stream.h on Solaris */
 /* struct queue is already defined in sys/stream.h on Solaris */
+#undef queue
 #define	queue _queue
 #define	queue _queue
 #endif
 #endif
 struct queue {
 struct queue {
@@ -144,7 +145,7 @@ static inline void *queue_item_get (struct queue *queue)
 static inline void queue_item_remove (struct queue *queue) {
 static inline void queue_item_remove (struct queue *queue) {
 	pthread_mutex_lock (&queue->mutex);
 	pthread_mutex_lock (&queue->mutex);
 	queue->tail = (queue->tail + 1) % queue->size;
 	queue->tail = (queue->tail + 1) % queue->size;
-	
+
 	assert (queue->tail != queue->head);
 	assert (queue->tail != queue->head);
 
 
 	queue->used--;
 	queue->used--;
@@ -156,7 +157,7 @@ static inline void queue_items_remove (struct queue *queue, int rel_count)
 {
 {
 	pthread_mutex_lock (&queue->mutex);
 	pthread_mutex_lock (&queue->mutex);
 	queue->tail = (queue->tail + rel_count) % queue->size;
 	queue->tail = (queue->tail + rel_count) % queue->size;
-	
+
 	assert (queue->tail != queue->head);
 	assert (queue->tail != queue->head);
 
 
 	queue->used -= rel_count;
 	queue->used -= rel_count;