hedgewars/pas2c.h
changeset 6896 23b38e530967
parent 6895 31def088a870
child 6898 344b0dbd9690
--- a/hedgewars/pas2c.h	Fri Apr 20 22:03:35 2012 +0400
+++ b/hedgewars/pas2c.h	Fri Apr 20 22:56:56 2012 +0400
@@ -2,9 +2,15 @@
 
 #include <stdbool.h>
 
-typedef struct string255_
+typedef union string255_
     {
-        char s[256];
+        struct {
+            char s[256];
+        };
+        struct {
+            char len;
+            char str[255];
+        };
     } string255;
 typedef struct string192_
     {
@@ -53,3 +59,4 @@
 string255 copy(string255 a, int s, int l);
 string255 delete(string255 a, int s, int l);
 
+#define STRCONSTDECL(a, b) const string255 a = {.len = sizeof(b), .str = b}