Bug 10206

Summary: PATCH: cairo_context_size
Product: cairo Reporter: Robert Carr <racarr>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED INVALID QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.4.1   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch adding cairo_context_size

Description Robert Carr 2007-03-06 18:25:18 UTC
In an experiment with shm and cairo I ran in to the need for sizeof(cairo_t) which obviously wont work because it's an incomplete type.

Rather than complete the type in my file (obivously a horrible idea), I've made a quick patch adding a cairo_context_size(void) function which returns sizeof(cairo_t)
Comment 1 Robert Carr 2007-03-06 18:25:58 UTC
Created attachment 9003 [details] [review]
Patch adding cairo_context_size

Patch
Comment 2 Robert Carr 2007-03-06 18:29:52 UTC
(In reply to comment #0)
> In an experiment with shm and cairo I ran in to the need for sizeof(cairo_t)
> which obviously wont work because it's an incomplete type.
> 
> Rather than complete the type in my file (obivously a horrible idea), I've made
> a quick patch adding a cairo_context_size(void) function which returns
> sizeof(cairo_t)
> 

An experiment might be the bad way to word it, I'm actually planning to use this

Comment 3 Behdad Esfahbod 2007-03-06 21:08:19 UTC
What are you trying to do that needs such a thing?!  This is deifnitely a WONTFIX.
Comment 4 Robert Carr 2007-03-06 21:24:58 UTC
It doesn't really make much sense to just have it for cairo_t anyway, though I think it might make a bit of sense to have it for all the incomplete structs.

What I was using it for turned out to not be a good idea anyway (Just using xshm for a pixmap makes a lot more sense...).

I'm going to go ahead and close this before I make myself look any more stupid.
Comment 5 Behdad Esfahbod 2007-03-06 21:27:36 UTC
Yeah, exposing the size defeats most of the reason to leave them incomplete in the first place.  That is, they cannot be expanded without breaking compatibility.

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.