More wrc-bugs fixes.

Francois Gouget fgouget at free.fr
Sun Jun 3 14:21:43 CDT 2001


> Added support for RCINCLUDE directive.Now wrc ignores everything 
> except preprocesor directives (#include #if #define and so on.) from 
> included *.h *.c files.

I was horrified when I saw:

+int is_c_h_include(char *fname)  
+{        
+       int sl=strlen(fname);
+       if (sl < 2) return 0;
+       if ((fname[sl-1]!='h') && (fname[sl-1]!='c')) return 0;
+        if (fname[sl-2]!='.') return 0;
+       return 1;
+}

   I thought the decision to pass stuff or not was based on '#include' 
vs. 'RCINCLUDE'. So I rechecked on Windows and you're right. They
specifically check for '.c' and '.h'!!!
   They even ignore '.cpp', '.cxx', '.hxx' and '.hpp'. This is so ugly.
   But their test is not case sensitive. So I propose to apply the
following patch on top of yours:

--- cut here---
Index: tools/wrc/ppl.l
===================================================================
RCS file: /home/wine/wine/tools/wrc/ppl.l,v
retrieving revision 1.4
diff -u -r1.4 ppl.l
--- tools/wrc/ppl.l	2000/07/08 11:49:29	1.4
+++ tools/wrc/ppl.l	2001/06/03 06:26:01
@@ -1428,7 +1428,7 @@
 {        
 	int sl=strlen(fname);
 	if (sl < 2) return 0;
-	if ((fname[sl-1]!='H') && (fname[sl-1]!='C')) return 0;
+	if ((toupper(fname[sl-1])!='H') && (toupper(fname[sl-1])!='C')) return 0;
         if (fname[sl-2]!='.') return 0;
 	return 1;
 }
--- cut here---


--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
                     Avoid the Gates of Hell - use Linux.







More information about the wine-patches mailing list