summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-05-23 20:24:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-05-23 20:24:56 (GMT)
commit6075b0d3f07eeac6144d0a6f7af0803cf9705b96 (patch)
tree68942779ee51e0b78ff44b01854354224d9e9e46 /generic/tclCompile.h
parent749f9c4ee0a50a7cedec339c2b3a69733fedf172 (diff)
downloadtcl-6075b0d3f07eeac6144d0a6f7af0803cf9705b96.zip
tcl-6075b0d3f07eeac6144d0a6f7af0803cf9705b96.tar.gz
tcl-6075b0d3f07eeac6144d0a6f7af0803cf9705b96.tar.bz2
Spare developers the burden and error risk of counting bytes in string
literals, or having to type them twice.
Diffstat (limited to 'generic/tclCompile.h')
-rw-r--r--generic/tclCompile.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 1cc296e..3909fa9 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -1358,15 +1358,19 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
TclCompileTokens((interp), (tokenPtr)+1, (tokenPtr)->numComponents, \
(envPtr));
/*
- * Convenience macro for use when pushing literals. The ANSI C "prototype" for
- * this macro is:
+ * Convenience macros for use when pushing literals. The ANSI C "prototype" for
+ * these macros are:
*
* static void PushLiteral(CompileEnv *envPtr,
* const char *string, int length);
+ * static void PushStringLiteral(CompileEnv *envPtr,
+ * const char *string);
*/
#define PushLiteral(envPtr, string, length) \
TclEmitPush(TclRegisterNewLiteral((envPtr), (string), (length)), (envPtr))
+#define PushStringLiteral(envPtr, string) \
+ PushLiteral((envPtr), (string), (int) (sizeof(string "") - 1))
/*
* Macro to advance to the next token; it is more mnemonic than the address