Bug 916589 - Rename __offsetof() to avoid conflict with platform-specific definition. r=docfaraday
authorJan Beich <jbeich@tormail.org>
Sun, 15 Sep 2013 10:47:00 +0200
changeset 184071 b328f846f2ee82cf327bdee732ccb30623617306
parent 184070 a8ebf53bc0cfe76987662517ac8400619a8f3e89
child 184072 c4c063d270ef437e8a4b1b6128dd96913b52d6fc
push id26810
push usercbook@mozilla.com
push dateWed, 21 May 2014 11:46:36 +0000
treeherdermozilla-central@50fb8c4db2fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdocfaraday
bugs916589
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 916589 - Rename __offsetof() to avoid conflict with platform-specific definition. r=docfaraday
media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
--- a/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+++ b/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
@@ -28,28 +28,27 @@
  *
  *	@(#)queue.h	8.5 (Berkeley) 8/20/94
  * $FreeBSD: src/sys/sys/queue.h,v 1.58 2004/04/07 04:19:49 imp Exp $
  */
 
 #ifndef _SYS_QUEUE_H_
 #define	_SYS_QUEUE_H_
 
-#if !defined(__FreeBSD__) && !defined(DARWIN)
 #include <stddef.h>
-#define __offsetof offsetof
+
+#ifndef offsetof
+#define offsetof(type, field) ((size_t)(&((type *)0)->field))
 #endif
 
 #define STAILQ_FOREACH_SAFE(var, head, field, tvar)                     \
          for ((var) = STAILQ_FIRST((head));                              \
              (var) && ((tvar) = STAILQ_NEXT((var), field), 1);           \
              (var) = (tvar))
 
-// #define __offsetof(type, field) ((size_t)(&((type *)0)->field))
-
 /*
  * This file defines four types of data structures: singly-linked lists,
  * singly-linked tail queues, lists and tail queues.
  *
  * A singly-linked list is headed by a single forward pointer. The elements
  * are singly linked for minimum space and pointer manipulation overhead at
  * the expense of O(n) removal for arbitrary elements. New elements can be
  * added to the list after an existing element or at the head of the list.
@@ -280,17 +279,17 @@ struct {								\
 	*(head)->stqh_last = (elm);					\
 	(head)->stqh_last = &STAILQ_NEXT((elm), field);			\
 } while (0)
 
 #define	STAILQ_LAST(head, type, field)					\
 	(STAILQ_EMPTY((head)) ?						\
 		NULL :							\
 	        ((struct type *)					\
-		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
+		((char *)((head)->stqh_last) - offsetof(struct type, field))))
 
 #define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
 
 #define	STAILQ_REMOVE(head, elm, type, field) do {			\
 	if (STAILQ_FIRST((head)) == (elm)) {				\
 		STAILQ_REMOVE_HEAD((head), field);			\
 	}								\
 	else {								\