Pārlūkot izejas kodu

Add conditional macro to compile with -fpack-struct

mingodad 7 gadi atpakaļ
vecāks
revīzija
d69baf5776
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      SquiLu/squirrel/sqstate.cpp

+ 5 - 0
SquiLu/squirrel/sqstate.cpp

@@ -661,7 +661,12 @@ SQString *SQStringTable::Add(const SQChar *news,SQInteger len)
 SQString *SQStringTable::Add(SQString *strBuf)
 SQString *SQStringTable::Add(SQString *strBuf)
 {
 {
 	SQHash newhash, h;
 	SQHash newhash, h;
+#ifdef SQ_PACKED_STRUCT
+	SQInteger blen = strBuf->_len;
+    SQString *t = Contains(strBuf->_val, blen, newhash, h);
+#else
     SQString *t = Contains(strBuf->_val, strBuf->_len, newhash, h);
     SQString *t = Contains(strBuf->_val, strBuf->_len, newhash, h);
+#endif
     if(t) {
     if(t) {
         SQ_FREE(strBuf,sizeof(SQString) + rsl(strBuf->_len));
         SQ_FREE(strBuf,sizeof(SQString) + rsl(strBuf->_len));
         return t;
         return t;