compile fixes for old dvb api (7020....)
[enigma2.git] / lib / base / object.h
index d0e2a65e54916e5a336b0b3e820517209ace5206..8cea2cd1ce4f29cc6dd19774be7a05a58010a030 100644 (file)
@@ -7,9 +7,7 @@
 
 //#define OBJECT_DEBUG
 
-#ifdef OBJECT_DEBUG
-       #include <lib/base/eerror.h>
-#endif
+#include <lib/base/eerror.h>
 
 typedef int RESULT;
 
@@ -31,9 +29,13 @@ public:
                volatile int count;
                oRefCount(): count(0) { }
                operator volatile int&() { return count; }
-               ~oRefCount() { 
+               ~oRefCount()
+               { 
        #ifdef OBJECT_DEBUG
-                       if (count) eDebug("OBJECT_DEBUG FATAL: %p has %d references!", this, count); else eDebug("OBJECT_DEBUG refcount ok! (%p)", this); 
+                       if (count)
+                               eDebug("OBJECT_DEBUG FATAL: %p has %d references!", this, count);
+                       else
+                               eDebug("OBJECT_DEBUG refcount ok! (%p)", this); 
        #endif
                }
        };
@@ -104,7 +106,7 @@ public:
                                if (!ref) \
                                        delete this; \
                        }
-       #elif defined(__ppc__)
+       #elif defined(__ppc__) || defined(__powerpc__)
                #define DECLARE_REF(x)                  \
                        private: oRefCount ref;         \
                        public: void AddRef();          \
@@ -139,6 +141,7 @@ public:
                                        delete this; \
                        }
        #else
+               #warning use non optimized implementation of refcounting.
                #define DECLARE_REF(x)                  \
                        private:oRefCount ref;  \
                                        eSingleLock ref_lock; \