Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: mod_export



I messed up mod_export markers in two ways:  there should be one for
(mb_)metacharlenconv(), and they weren't generated properly for the
stdargs/varargs-convoluted function declarations.

Index: Src/makepro.awk
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/makepro.awk,v
retrieving revision 1.3
diff -u -r1.3 makepro.awk
--- Src/makepro.awk	5 Jun 2006 16:55:38 -0000	1.3
+++ Src/makepro.awk	4 Aug 2006 11:36:06 -0000
@@ -91,6 +91,7 @@
     # Handle each declarator.
     if (match(line, /VA_ALIST/)) {
 	# Already has VARARGS handling.
+
 	# Put parens etc. back
 	gsub(/@[{]/, "((", line)
 	gsub(/@}/, "))", line)
@@ -105,6 +106,13 @@
 	if(locality ~ /E/)
 	    dtype = "extern " dtype
 
+	if (match(line, /[_0-9A-Za-z]+\(VA_ALIST/))
+	  dnam = substr(line, RSTART, RLENGTH-9)
+
+	# If this is exported, add it to the exported symbol list.
+	if (exported)
+	    printf "X%s\n", dnam
+
 	printf "%s%s %s\n", locality, dtype, line
     } else {
 	while(match(line, /^[^,]*,/)) {
Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.131
diff -u -r1.131 utils.c
--- Src/utils.c	3 Aug 2006 15:37:49 -0000	1.131
+++ Src/utils.c	4 Aug 2006 11:36:08 -0000
@@ -3877,7 +3877,7 @@
  */
 
 /**/
-int
+mod_export int
 mb_metacharlenconv(const char *s, wint_t *wcp)
 {
     char inchar;
@@ -3980,7 +3980,7 @@
 /* Simple replacement for mb_metacharlenconv */
 
 /**/
-int
+mod_export int
 metacharlenconv(char *x, int *c)
 {
     if (*x == Meta) {

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php



Messages sorted by: Reverse Date, Date, Thread, Author