I maintain multiple libs that do this approach, there is no good way to handle 
this without microsoft or the toolchain making a standard header for this that 
we can test for.  In lieu of that, you really need to do it yourself, and you 
still then have the issue of ifdef protecting them against re-definition.  A 
sane way to handle this with mingw would be to have an inittypes.h and stdint.h 
file in a subdir in the tree somewhere, and a configure check to test for that, 
and if it fails, add that dir to the includes so it uses ours instead.  
Requiring users to install extra stuff is just making it harder for people to 
build and use, and I think is a bad approach.  Also, we could check these in, 
and just put them in the include chain for the windows build, they do have 
ifdef checks to avoid multiple inclusion, but we might want to add ifndefs to 
avoid redefinition from other code due to the history of hack fixes for this 
issue.

Mike


On Jun 18, 2010, at 8:39 AM, Stefano Sabatini wrote:

> Hi all,
> 
> I'm trying to use sofia-sip, compiling a project in Windows using
> MinGW (which would allow an Eclipse-based development environment).
> 
> I'm using MS VS2005 for compiling libsofia-sip, as compilation with
> MinGW fails (see thread:
> "Problem compiling sofia-sip 1.12.10 for MinGW"
> http://thread.gmane.org/gmane.comp.telephony.sofia-sip.devel/3853
> ).
> 
> I fail to see if the config.h, when compiling with VS, has to be set
> by hand or if it is generated automatically as per the linux
> configuration.
> 
> Furthermore, I'm failing to compile against sofia-sip headers, as
> MinGW already defines its inttypes and su_types.h is re-defining them.
> 
> Even compiling with VS I believe those re-definitions should be
> avoided and I remember having had problems with them in the past.
> 
> I suggest to require the user to install this instead:
> http://code.google.com/p/msinttypes/downloads/list
> 
> The re-definition trick looks to me basically flawed, for example if a
> program uses more than one lib, and each one re-defines the int types,
> there will always be multiple definition problems whenever the headers
> of both the libs are included.
> 
> Regards.
> 
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
> lucky parental unit.  See the prize list and enter to win: 
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Sofia-sip-devel mailing list
> Sofia-sip-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to