Change 26635 by [EMAIL PROTECTED] on 2006/01/04 10:44:48

        Introduce STR_WITH_LEN macro in the form suggested by Chip.

Affected files ...

... //depot/perl/handy.h#108 edit
... //depot/perl/toke.c#622 edit

Differences ...

==== //depot/perl/handy.h#108 (text) ====
Index: perl/handy.h
--- perl/handy.h#107~26606~     2006-01-03 07:46:10.000000000 -0800
+++ perl/handy.h        2006-01-04 02:44:48.000000000 -0800
@@ -236,6 +236,9 @@
 
 #define Ctl(ch) ((ch) & 037)
 
+/* concatenating with "" ensures that only literal strings are accepted as 
agument */
+#define STR_WITH_LEN(s)  (s ""), (sizeof(s)-1)
+
 /*
 =head1 Miscellaneous Functions
 

==== //depot/perl/toke.c#622 (text) ====
Index: perl/toke.c
--- perl/toke.c#621~26598~      2006-01-03 04:29:38.000000000 -0800
+++ perl/toke.c 2006-01-04 02:44:48.000000000 -0800
@@ -460,7 +460,7 @@
 
 #define FEATURE_IS_ENABLED(name)                                       \
        ((0 != (PL_hints & HINT_LOCALIZE_HH))                           \
-           && feature_is_enabled((name ""), sizeof(name)-1))
+           && feature_is_enabled(STR_WITH_LEN(name)))
 /*
  * S_feature_is_enabled
  * Check whether the named feature is enabled.
End of Patch.

Reply via email to