Bug 47839

Summary: Namespace conflict due to "_write" while compiling for MinGW target
Product: cairo Reporter: Marko Lindqvist <cazfi74>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium CC: avuton, john
Version: 1.12.0   
Hardware: Other   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Renaming patch

Description Marko Lindqvist 2012-03-25 05:18:43 UTC
Compiling cairo-1.12.0 for MinGW target errors:
src/cairo-1.12.0/test/any2ppm.c:126: error: conflicting types for ‘_write’
/usr/i586-mingw32msvc/include/io.h:253: error: previous declaration of ‘_write’ was here

It seems that "_write" is defined in public MinGW headers. Renaming cairo side _write fixes allows compilation to proceed.
Comment 1 Avuton Olrich 2012-03-28 05:48:09 UTC
Confirm.
Comment 2 John Lindgren 2012-04-01 18:45:37 UTC
Created attachment 59358 [details] [review]
Renaming patch

How about renaming _write() to do_write() and _writen() to do_writen()?
Comment 3 Uli Schlachter 2012-04-10 04:27:30 UTC
commit 3f32419257bb2e380dd63a3b1a850b512a617776
Author: Maarten Bosmans <mkbosmans@gmail.com>
Date:   Mon Apr 9 21:33:49 2012 +0200

    test: Give some functions in any2ppm a prefix
    
    The function name _write is too generic and can clash with already
    defined functions.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.