Hello,
I solved the problem by correcting the "gen-declspecs.pl" file in the case of
two successive #define tag.
I don't understand how a file which has not changed years ago can be false, in
more Perl is not my preferred language and I'm not sure what I'm really
doing... but this correction permits me to compile all Agar with MSYS/MinGW.
I shall also send a new valid procedure to compile with MSYS/MinGW.
Following is the "gen-declspecs.pl" SVN patch, I wish I help ^^
Jean-Claude
Index: gen-declspecs.pl
===================================================================
--- gen-declspecs.pl (revision 9625)
+++ gen-declspecs.pl (working copy)
@@ -109,6 +109,7 @@
my $inline = 0;
my $comment = 0;
my $stmt = 0;
+my $define = 0;
my $stmtLine = '';
foreach $_ (@input) {
if (/^\s*__BEGIN_DECLS\s*$/) {
@@ -135,58 +136,78 @@
next;
}
- # Strip comments in block
- s/(\/\*.*\*\/)//g;
- s/(\/\/.*)//g;
+ if(!$define) {
+ # Strip comments in block
+ s/(\/\*.*\*\/)//g;
+ s/(\/\/.*)//g;
- # Begin/resume inline block
- if ($inline) {
- push @blk, $_;
- if (/^}\s*/) {
- $inline = 0;
+ # Begin/resume inline block
+ if ($inline) {
+ push @blk, $_;
+ if (/^}\s*/) {
+ $inline = 0;
+ }
+ next;
+ } elsif (/^static __inline__ /) {
+ $inline = 1;
+ push @blk, '', $_;
+ next;
}
- next;
- } elsif (/^static __inline__ /) {
- $inline = 1;
- push @blk, '', $_;
- next;
- }
-
- # Begin/resume comment block
- if ($comment) {
- if (/\s*\*\/\s*$/) {
- $comment = 0;
+
+ # Begin/resume comment block
+ if ($comment) {
+ if (/\s*\*\/\s*$/) {
+ $comment = 0;
+ }
+ push @blk, $_;
+ next;
+ } elsif (/^\s*\/\*/) {
+ $comment = 1;
+ push @blk, $_;
+ next;
}
- push @blk, $_;
- next;
- } elsif (/^\s*\/\*/) {
- $comment = 1;
- push @blk, $_;
- next;
- }
- # Ignore cpp directives.
- if (/^\s*#/) {
- push @blk, $_;
- next;
- }
+ # Ignore cpp directives.
+ if(/^\s*#.*\\\s*/) {
+ s/\s*$//g;
+ push @blk, $_;
+ $define = 1;
+ next;
+ } elsif (/^\s*#/) {
+ push @blk, $_;
+ next;
+ }
- # Begin/resume C statement
- if ($stmt) {
- $stmtLine .= ' '.$_;
- if (/;\s*$/) {
- $stmt = 0;
- push @blk, $stmtLine;
- $stmtLine = '';
- }
- next;
- } else {
- unless (/;\s*$/) {
- $stmt = 1;
- $stmtLine = $_;
+ # Begin/resume C statement
+ if ($stmt) {
+ $stmtLine .= ' '.$_;
+ if (/;\s*$/) {
+ $stmt = 0;
+ push @blk, $stmtLine;
+ $stmtLine = '';
+ }
next;
+ } else {
+ unless (/;\s*$/) {
+ $stmt = 1;
+ $stmtLine = $_;
+ next;
+ }
}
}
+ elsif(/^.*\\\s*$/) {
+ s/\s*$//g;
+ push @blk, $_;
+ $define = 1;
+ next;
+ }
+ else {
+ s/\s*$//g;
+ push @blk, $_;
+ $define = 0;
+ next;
+ }
+
push @blk, $_;
}
________________________________
De : Jean-Claude Vogel <[email protected]>
À : "[email protected]" <[email protected]>
Envoyé le : Samedi 31 août 2013 11h37
Objet : [Agar] MinGW MSYS ./configure problem
Hello,
I'm trying to compile the agar SVN trunk in order to get the corrected
"console.c".
In SVN I can see :
In "agar-trunk/core/load_string.h" line 14 :
#define AG_ReadString(nb) \
AG_ReadStringLen((nb),AG_LOAD_STRING_MAX)
#define AG_ReadStringv(nb,s) \
AG_ReadStringLenv((nb),AG_LOAD_STRING_MAX,(s))
But after the "./configure" execution I have in
"agar-trunk\include\agar\core\load_string.h" line 14 :
#define AG_ReadString(nb) \
#define AG_ReadStringv(nb,s) \
AG_ReadStringLen((nb),AG_LOAD_STRING_MAX)
AG_ReadStringLenv((nb),AG_LOAD_STRING_MAX,(s)) void
AG_WriteString(AG_DataSource *, const char *);
As you can see the first #define is directly followed by the second one, and
the value of the first is after the second #define...
Of course, if I change the original load_string.h to suppress the newline and
backslash associated I get the same problem with a lot of other header files.
Do you know which would be the source of the problem, Msys, MinGW or Agar ?
Jean-Claude
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html