michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_RefCountType_h michael@0: #define mozilla_RefCountType_h michael@0: michael@0: #include michael@0: michael@0: /** michael@0: * MozRefCountType is Mozilla's reference count type. michael@0: * michael@0: * We use the same type to represent the refcount of RefCounted objects michael@0: * as well, in order to be able to use the leak detection facilities michael@0: * that are implemented by XPCOM. michael@0: * michael@0: * Note that this type is not in the mozilla namespace so that it is michael@0: * usable for both C and C++ code. michael@0: */ michael@0: typedef uintptr_t MozRefCountType; michael@0: michael@0: /* michael@0: * This is the return type for AddRef() and Release() in nsISupports. michael@0: * IUnknown of COM returns an unsigned long from equivalent functions. michael@0: * michael@0: * The following ifdef exists to maintain binary compatibility with michael@0: * IUnknown, the base interface in Microsoft COM. michael@0: */ michael@0: #ifdef XP_WIN michael@0: typedef unsigned long MozExternalRefCountType; michael@0: #else michael@0: typedef uint32_t MozExternalRefCountType; michael@0: #endif michael@0: michael@0: #endif