Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311952 - Build fix for MinGW build of TCF agent
Summary: Build fix for MinGW build of TCF agent
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.3   Edit
Assignee: Project Inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 14:39 EDT by Ed Swartz CLA
Modified: 2013-06-05 06:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Swartz CLA 2010-05-06 14:39:59 EDT
We build the Windows TCF agent using Mingw 3.4.5.  We include some C++ sources in our side, and when using these, the compiler issues errors due to this line in mdep.h:

(line 131)
#define snprintf _snprintf

with such reports as, e.g.:

C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/cstdio:167: error: `::snprintf' has not been declared
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/cstdio:177: error: `__gnu_cxx::snprintf' has not been declared
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/mingw32/bits/c++locale.h:72: error: `snprintf' is not a member of `std'

This kind of #define pattern seems like an MSVC-ism (to access extension functions which aren't in standard C).  This pattern seems to be unnecessary in GCC-derived builds.

Is it safe to just guard these as:

(mdep.h line 128)
#ifdef _MSC_VER
#define utimbuf _utimbuf
#define utime   _utime
#define futime  _futime
#define snprintf _snprintf
#endif

I did this and the build succeeded under MinGW, so it seems safe...
Comment 1 Eugene Tarassov CLA 2010-05-06 17:17:34 EDT
I have committed the fix.
Thanks.
Comment 2 Martin Oberhuber CLA 2010-05-28 14:08:56 EDT
Bulk update: Marking all TCF fixes from the Helios period (2009-06-29 until 2010-06-01) as target 3.2 since they go through release review along with the TM 3.2 release.
Comment 3 Doug Schaefer CLA 2011-05-17 10:48:27 EDT
Moving bugs to new home for IP log.
Comment 4 Martin Oberhuber CLA 2013-06-05 06:25:37 EDT
Bulk change: Marking all bugs from the TM era (until June 2011) target 0.3