[Expat-bugs] [ expat-Bugs-1602769 ] Problem with .c file inclusion (and how to fix it)

SourceForge.net noreply at sourceforge.net
Sat Nov 25 19:16:50 CET 2006


Bugs item #1602769, was opened at 2006-11-25 19:14
Message generated for change (Comment added) made by hartwork
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1602769&group_id=10127

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Sebastian Pipping (hartwork)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problem with .c file inclusion (and how to fix it)

Initial Comment:
 
 
The file "xmltok.c" includes two other .c files:
"xmltok_ns.c" and "xmltok_impl.c".
The result of this is that the two included
.c files must not be in the list of files directly
passed to the compiler which means that in both
Visual Studio and Code::Blocks you cannot add
these to .c files to the tree view since they
would also get compiled then which results in
errors.

What I want to offer and ask for is to include
this little fix which still allows to include
the c files as before but also solves the IDE trouble.
A few preprocessor instructions can solve all the
mess for us.

I hope both the problem description and solution below
are understandable. Please contact me if now so I have
another chance to explain. Also you can look how applied
this soluation to the Expat version that i "ship" with
libSpiff:
http://libspiff.svn.sourceforge.net/viewvc/libspiff/trunk/win32/Expat/

Would be great to see this fix in the next release.
Keep up the good work! Best regards, Sebastian



== file "xmltok.c" ==
OLD
#include "xmltok_impl.c"

NEW (3 times!)
#define XML_TOK_IMPL_C
#include "xmltok_impl.c"
#undef XML_TOK_IMPL_C

OLD
#include "xmltok_ns.c"

NEW (3 times!)
#define XML_TOK_NS_C
#include "xmltok_ns.c"
#undef XML_TOK_NS_C



== file "xmltok_ns.c" ==
embrace the whole file with this:

OPEN
/* This file is included! */
#ifdef XML_TOK_NS_C

CLOSE
#endif /* def XML_TOK_NS_C */



== file "xmltok_ns.c" ==
embrace the whole file with this:

OPEN
/* This file is included! */
#ifdef XML_TOK_IMPL_C

CLOSE
#endif /* def XML_TOK_IMPL_C */



EOF


----------------------------------------------------------------------

>Comment By: Sebastian Pipping (hartwork)
Date: 2006-11-25 19:16

Message:
Logged In: YES 
user_id=1022691
Originator: YES

The last section mus be labeled

== file "xmltok_impl.c" ==

instead of

== file "xmltok_ns.c" ==


Sorry.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1602769&group_id=10127


More information about the Expat-bugs mailing list