Browse Source

Attempt at a fix for comparing extern structs.

Mark Sibly 9 years ago
parent
commit
63a95b87a9
1 changed files with 7 additions and 3 deletions
  1. 7 3
      modules/monkey/native/bbtypes.h

+ 7 - 3
modules/monkey/native/bbtypes.h

@@ -45,9 +45,13 @@ namespace detail{
 
 
 bbString bbTypeName( const char *type );
 bbString bbTypeName( const char *type );
 
 
-template<class X,class Y> int bbCompare( X x,Y y ){
-	if( y>x ) return -1;
-	return x>y;
+template<class T> bool operator<( const T &x,const T &y ){
+	return memcmp( &x,&y,sizeof(T) );
+}
+
+template<class X,class Y> int bbCompare( const X &x,const Y &y ){
+	if( x<y ) return -1;
+	return y<x;
 }
 }
 
 
 #endif
 #endif