Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311952

Summary: Build fix for MinGW build of TCF agent
Product: [Tools] TCF Reporter: Ed Swartz <ed.swartz>
Component: CoreAssignee: Project Inbox <dsdp.tm.tcf-inbox>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, eugene
Version: unspecified   
Target Milestone: 0.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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