Commit d59fd796 authored by unknown's avatar unknown

Construction does not work on hpux aCC, so some refactoring

parent 08b2090c
...@@ -1051,18 +1051,7 @@ class Ndb ...@@ -1051,18 +1051,7 @@ class Ndb
friend class NdbDictionaryImpl; friend class NdbDictionaryImpl;
friend class NdbDictInterface; friend class NdbDictInterface;
friend class NdbBlob; friend class NdbBlob;
friend class Ndb_free_list_t<NdbRecAttr>; friend class NdbImpl;
friend class Ndb_free_list_t<NdbApiSignal>;
friend class Ndb_free_list_t<NdbLabel>;
friend class Ndb_free_list_t<NdbBranch>;
friend class Ndb_free_list_t<NdbSubroutine>;
friend class Ndb_free_list_t<NdbCall>;
friend class Ndb_free_list_t<NdbBlob>;
friend class Ndb_free_list_t<NdbReceiver>;
friend class Ndb_free_list_t<NdbIndexScanOperation>;
friend class Ndb_free_list_t<NdbOperation>;
friend class Ndb_free_list_t<NdbIndexOperation>;
friend class Ndb_free_list_t<NdbTransaction>;
#endif #endif
public: public:
......
...@@ -89,6 +89,15 @@ public: ...@@ -89,6 +89,15 @@ public:
return 0; return 0;
} }
/*
We need this friend accessor function to work around a HP compiler problem,
where template class friends are not working.
*/
static inline void setNdbError(Ndb &ndb,int code){
ndb.theError.code = code;
return;
}
/** /**
* NOTE free lists must be _after_ theNdbObjectIdMap take * NOTE free lists must be _after_ theNdbObjectIdMap take
* assure that destructors are run in correct order * assure that destructors are run in correct order
...@@ -208,7 +217,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt) ...@@ -208,7 +217,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt)
m_free_list = new T(ndb); m_free_list = new T(ndb);
if (m_free_list == 0) if (m_free_list == 0)
{ {
ndb->theError.code = 4000; NdbImpl::setNdbError(*ndb, 4000);
assert(false); assert(false);
return -1; return -1;
} }
...@@ -218,7 +227,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt) ...@@ -218,7 +227,7 @@ Ndb_free_list_t<T>::fill(Ndb* ndb, Uint32 cnt)
T* obj= new T(ndb); T* obj= new T(ndb);
if(obj == 0) if(obj == 0)
{ {
ndb->theError.code = 4000; NdbImpl::setNdbError(*ndb, 4000);
assert(false); assert(false);
return -1; return -1;
} }
...@@ -250,7 +259,7 @@ Ndb_free_list_t<T>::seize(Ndb* ndb) ...@@ -250,7 +259,7 @@ Ndb_free_list_t<T>::seize(Ndb* ndb)
} }
else else
{ {
ndb->theError.code = 4000; NdbImpl::setNdbError(*ndb, 4000);
assert(false); assert(false);
} }
return tmp; return tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment