cppbind: fix testing for naRef identity.

This commit is contained in:
Thomas Geymayer
2014-03-31 14:21:21 +02:00
parent d332da0605
commit a160e176da
3 changed files with 5 additions and 1 deletions

View File

@@ -180,7 +180,7 @@ int main(int argc, char* argv[])
VERIFY( fmem );
naRef ret = fmem(hash.get_naRef()),
hash_ref = hash.get_naRef();
VERIFY( memcmp(&ret, &hash_ref, sizeof(naRef)) == 0 );
VERIFY( naIsIdentical(ret, hash_ref) );
// Check if nasal::Me gets passed as self/me and remaining arguments are
// passed on to function

View File

@@ -244,6 +244,7 @@ int naIsFunc(naRef r) { return IS_FUNC(r); }
int naIsCode(naRef r) { return IS_CODE(r); }
int naIsCCode(naRef r) { return IS_CCODE(r); }
int naIsGhost(naRef r) { return IS_GHOST(r); }
int naIsIdentical(naRef l, naRef r) { return IDENTICAL(l, r); }
void naSetUserData(naContext c, void* p) { c->userData = p; }
void* naGetUserData(naContext c)

View File

@@ -180,6 +180,9 @@ int naIsCode(naRef r) GCC_PURE;
int naIsFunc(naRef r) GCC_PURE;
int naIsCCode(naRef r) GCC_PURE;
// Object equality (check for same instance, aka. pointer equality)
int naIsIdentical(naRef l, naRef r) GCC_PURE;
// Allocators/generators:
naRef naNil() GCC_PURE;
naRef naNum(double num) GCC_PURE;