- Timestamp:
- Oct 20, 2016 12:11:23 PM (8 years ago)
- Location:
- trunk/src/libs/xpcom18a4/python/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/python/src/PyIID.cpp
r59809 r64330 319 319 } 320 320 321 #if PY_VERSION_HEX >= 0x03020000 322 /* static */Py_hash_t 323 Py_nsIID::PyTypeMethod_hash(PyObject *self) 324 #else 321 325 /* static */long 322 326 Py_nsIID::PyTypeMethod_hash(PyObject *self) 327 #endif 323 328 { 324 329 const nsIID &iid = ((Py_nsIID *)self)->m_iid; 325 330 331 #if PY_VERSION_HEX >= 0x03020000 332 Py_hash_t ret = iid.m0 + iid.m1 + iid.m2; 333 #else 326 334 long ret = iid.m0 + iid.m1 + iid.m2; 335 #endif 327 336 for (int i=0;i<7;i++) 328 337 ret += iid.m3[i]; -
trunk/src/libs/xpcom18a4/python/src/PyXPCOM.h
r59798 r64330 287 287 static int Py_cmp(PyObject *ob1, PyObject *ob2); 288 288 static PyObject *Py_richcmp(PyObject *ob1, PyObject *ob2, int op); 289 #if PY_VERSION_HEX >= 0x03020000 290 static Py_hash_t Py_hash(PyObject *self); 291 #else 289 292 static long Py_hash(PyObject *self); 293 #endif 290 294 }; 291 295 … … 443 447 static PyObject *PyTypeMethod_richcompare(PyObject *self, PyObject *ob, int op); 444 448 static PyObject *PyTypeMethod_repr(PyObject *self); 449 #if PY_VERSION_HEX >= 0x03020000 450 static Py_hash_t PyTypeMethod_hash(PyObject *self); 451 #else 445 452 static long PyTypeMethod_hash(PyObject *self); 453 #endif 446 454 static PyObject *PyTypeMethod_str(PyObject *self); 447 455 static void PyTypeMethod_dealloc(PyObject *self); -
trunk/src/libs/xpcom18a4/python/src/TypeObject.cpp
r62377 r64330 156 156 157 157 // @pymethod int|Py_nsISupports|__hash__|Implement a hash-code for the XPCOM object using XPCOM identity rules. 158 #if PY_VERSION_HEX >= 0x03020000 159 /*static*/Py_hash_t PyXPCOM_TypeObject::Py_hash(PyObject *self) 160 #else 158 161 /*static*/long PyXPCOM_TypeObject::Py_hash(PyObject *self) 162 #endif 159 163 { 160 164 // We always return the value of the nsISupports *. … … 162 166 if (!Py_nsISupports::InterfaceFromPyObject(self, NS_GET_IID(nsISupports), &pUnkThis, PR_FALSE)) 163 167 return -1; 168 #if PY_VERSION_HEX >= 0x03020000 169 Py_hash_t ret = _Py_HashPointer(pUnkThis); 170 #else 164 171 long ret = _Py_HashPointer(pUnkThis); 172 #endif 165 173 pUnkThis->Release(); 166 174 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.