[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1274
Date       : Thu Jun  8 20:58:12 BST 2006

Changed paths:
   M /Trunk/XaraLX/Scripts/gendeps.pl
   M /Trunk/XaraLX/wxOil/resources.cpp

Make the dummy resources.cpp include camtypes.h so it reads it as a pch


Diff:
Index: Trunk/XaraLX/Scripts/gendeps.pl
===================================================================
--- Trunk/XaraLX/Scripts/gendeps.pl	(revision 1273)
+++ Trunk/XaraLX/Scripts/gendeps.pl	(revision 1274)
@@ -22,6 +22,7 @@
  Options:
    -t target           - Print files that "target" depends on
    -i includedfile     - Print targets that depend on includedfile
+   -w                  - warn if camtypes.h is not the first included file
    -e                  - Explain why (in context of -t or -n)
                          This may take some time
    -n                  - Just print the totals
@@ -71,12 +72,13 @@
 my $help=0;
 my $verbose=0;
 my $total=0;
+my $warning=0;
 
-
 GetOptions( "target|t=s" => \$target,
             "includedfile|i=s" => \$includedfile,
             "explain|f!" => \$explain,
             "total|n!" => \$total,
+            "warning|w!" => \$warning,
             "verbose|v+" => \$verbose,
             "help!" => \$help ) || usage ("Bad option");
 
@@ -361,6 +363,8 @@
 
     print STDERR "Processing $fn
" if $verbose;
     
+    my $firstinclude = 1;
+
     my $line;
     while (defined($line=<DEPFILE>))
     {
@@ -378,6 +382,16 @@
 	next unless $line=~ /^\s*#include\s+[\"\<](\w+\.h)[\"\>]/;
 
 	my $d=basename($1);
+
+	if ($firstinclude)
+	{
+	    $firstinclude = 0;
+	    if ($warning && ($d ne "camtypes.h") && ($fn=~/.cpp$/) && ($fn!~/^wxXtra\//))
+	    {
+		print "$fn: Does not include camtypes.h first - has $d
";
+	    }
+	}
+
 	if (defined($includedependencies{$d}))
 	{
 	    print STDERR "  includes $d
" if ($verbose>2);
@@ -488,7 +502,7 @@
 }
 
 # Process files manually if necessary
-if ($explain)
+if ($explain || $warning)
 {
     my $f;
     my %seen=();
Index: Trunk/XaraLX/wxOil/resources.cpp
===================================================================
--- Trunk/XaraLX/wxOil/resources.cpp	(revision 1273)
+++ Trunk/XaraLX/wxOil/resources.cpp	(revision 1274)
@@ -98,5 +98,6 @@
 
 // This file merely includes the auto-generated resources.h
 // NO OTHER FILE SHOULD INCLUDE THIS
+#include "camtypes.h"
 
 #include "resources.h"


Xara