Try different expansion for CONST_STRING macro.
This commit is contained in:
+3
-3
@@ -698,9 +698,9 @@ ObjModule* wrenNewModule(WrenVM* vm);
|
|||||||
Value wrenNewRange(WrenVM* vm, double from, double to, bool isInclusive);
|
Value wrenNewRange(WrenVM* vm, double from, double to, bool isInclusive);
|
||||||
|
|
||||||
// Creates a new string object from [text], which should be a bare C string
|
// Creates a new string object from [text], which should be a bare C string
|
||||||
// literal. This determines the length of the string automatically at compile
|
// literal. Calling strlen() in the macro and passing in a string literal
|
||||||
// time based on the size of the character array -1 for the terminating '\0'.
|
// enables most compilers to evaluate the string length at compile time.
|
||||||
#define CONST_STRING(vm, text) wrenNewString((vm), (text), sizeof(text) - 1)
|
#define CONST_STRING(vm, text) wrenNewString((vm), (text), strlen(text))
|
||||||
|
|
||||||
// Creates a new string object of [length] and copies [text] into it.
|
// Creates a new string object of [length] and copies [text] into it.
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user