diff options
Diffstat (limited to 'lstring.h')
| -rw-r--r-- | lstring.h | 12 |
1 files changed, 10 insertions, 2 deletions
| @@ -20,10 +20,18 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | /* | 22 | /* |
| 23 | ** Size of a TString: Size of the header plus space for the string | 23 | ** Size of a short TString: Size of the header plus space for the string |
| 24 | ** itself (including final '\0'). | 24 | ** itself (including final '\0'). |
| 25 | */ | 25 | */ |
| 26 | #define sizelstring(l) (offsetof(TString, contents) + ((l) + 1) * sizeof(char)) | 26 | #define sizestrshr(l) \ |
| 27 | (offsetof(TString, contents) + ((l) + 1) * sizeof(char)) | ||
| 28 | |||
| 29 | /* | ||
| 30 | ** Size of a long TString: Size of the header plus space for the string | ||
| 31 | ** itself (including final '\0'). | ||
| 32 | */ | ||
| 33 | #define sizestrlng(l) (sizeof(TString) + ((l) + 1) * sizeof(char)) | ||
| 34 | |||
| 27 | 35 | ||
| 28 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ | 36 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ |
| 29 | (sizeof(s)/sizeof(char))-1)) | 37 | (sizeof(s)/sizeof(char))-1)) |
