[Cairo] ELF shared library improvements [0/4]

Richard Henderson rth at twiddle.net
Tue Jul 29 00:01:48 PDT 2003


Hmm, I think I lied about patch 1 being the smallest.
The libXc patch is actually a bit smaller.


r~
-------------- next part --------------
Index: src/Xc.h
===================================================================
RCS file: /local/src/CVS/Xc/src/Xc.h,v
retrieving revision 1.10
diff -c -p -d -u -p -r1.10 Xc.h
--- src/Xc.h	29 May 2003 02:34:41 -0000	1.10
+++ src/Xc.h	29 Jul 2003 07:00:30 -0000
@@ -33,6 +33,12 @@
 #include <ic.h>
 #include <pixregion.h>
 
+#ifdef _XCINT_H_
+#include <bits/export.h>
+#else
+#include <bits/import.h>
+#endif
+
 typedef struct _XcSurface		XcSurface;
 typedef XRenderColor			XcColor;
 
@@ -43,36 +49,36 @@ _XFUNCPROTOBEGIN
 /* XXX: What's the best way to support both windows and pixmaps? Right
    now, this function uses exclusively visual or render_format. Visual
    is examined first and used if non-null. */
-XcSurface *
+extern XcSurface * __external_linkage
 XcSurfaceCreateForDrawable (Display	*dpy,
 			    Drawable	drawable, 
 			    Visual	*visual,
 			    int		render_format,
 			    Colormap	colormap);
 
-XcSurface *
+extern XcSurface * __external_linkage
 XcSurfaceCreateForIcImage (IcImage	*image);
 
-void
+extern void __external_linkage
 XcSurfaceDestroy (XcSurface	*surface);
 
 /* surface manipulation */
 
 /* XXX: Need to resolve Region vs. PixRegion * before this can work
-void
+extern void __external_linkage
 XcSurfaceSetClipRegion (XcSurface	*surface,
 			Region		region);
 */
 
-void
+extern void __external_linkage
 XcSurfaceSetAlphaMap (XcSurface	*surface,
 		      XcSurface	*alpha);
 
-void
+extern void __external_linkage
 XcSurfaceSetTransform (XcSurface	*surface,
 		       XTransform	*transform);
 
-void
+extern void __external_linkage
 XcSurfaceGetTransform (XcSurface	*surface,
 		       XTransform	*transform);
 
@@ -84,17 +90,17 @@ typedef enum {
     XcFilterBilinear = IcFilterBilinear
 } XcFilter;
 
-void
+extern void __external_linkage
 XcSurfaceSetFilter (XcSurface	*surface,
 		    XcFilter	filter);
 
-void
+extern void __external_linkage
 XcSurfaceSetRepeat (XcSurface	*surface,
 		    int		repeat);
 
 /* XXX: Questions: should the data pointer be unsigned? Do we want to
    switch away from the char * for reasons of endian-ness? */
-void
+extern void __external_linkage
 XcSurfacePutImage (XcSurface		*surface,
 		   unsigned char	*data,
 		   unsigned int		width,
@@ -103,7 +109,7 @@ XcSurfacePutImage (XcSurface		*surface,
 
 /* compositing */
 
-void
+extern void __external_linkage
 XcComposite (int		op,
 	     XcSurface		*src,
 	     XcSurface		*mask,
@@ -117,7 +123,7 @@ XcComposite (int		op,
 	     unsigned int	width,
 	     unsigned int	height);
 
-void
+extern void __external_linkage
 XcFillRectangle (int		op,
 		 XcSurface	*dst,
 		 const XcColor	*color,
@@ -126,14 +132,14 @@ XcFillRectangle (int		op,
 		 unsigned int	width,
 		 unsigned int	height);
 
-void
+extern void __external_linkage
 XcFillRectangles (int			op,
 		  XcSurface		*dst,
 		  const XcColor		*color,
 		  const XRectangle	*rects,
 		  int			nrects);
 
-void
+extern void __external_linkage
 XcCompositeTrapezoids (int		op,
 		       XcSurface	*src,
 		       XcSurface	*dst,
@@ -142,7 +148,7 @@ XcCompositeTrapezoids (int		op,
 		       const XTrapezoid	*traps,
 		       int		ntraps);
 
-void
+extern void __external_linkage
 XcCompositeTriangles (int		op,
 		      XcSurface		*src,
 		      XcSurface		*dst,
@@ -157,9 +163,10 @@ XcCompositeTriangles (int		op,
    world. For now, though, while Xr is using Xft and until we decide
    the long-term plan for sharing code between Xft/Xc, Xr needs this
    function. */
-Picture
+extern Picture __external_linkage
 XcSurfaceGetPicture(XcSurface *surface);
 
 _XFUNCPROTOEND
+#undef __external_linkage
 
-#endif
+#endif /* _XC_H_ */
Index: src/xcint.h
===================================================================
RCS file: /local/src/CVS/Xc/src/xcint.h,v
retrieving revision 1.5
diff -c -p -d -u -p -r1.5 xcint.h
--- src/xcint.h	15 May 2003 01:16:16 -0000	1.5
+++ src/xcint.h	29 Jul 2003 07:00:30 -0000
@@ -28,6 +28,7 @@
 #define _XCINT_H_
 
 #include "Xc.h"
+#include <bits/internal.h>
 
 #define XC_SURFACE_RENDER_AT_LEAST(surface, major, minor) \
 	(((surface)->render_major > major) ? 1		  \
@@ -76,10 +77,10 @@ struct _XcSurface {
 /* XXX: Can someone think of better names for these? These functions
    are used when there are two copies of the image data. One where the
    user wants it, and another one local for manipulation. */
-void
+extern void __internal_linkage
 _XcSurfacePullImage (XcSurface *surface);
 
-void
+extern void __internal_linkage
 _XcSurfacePushImage (XcSurface *surface);
 
 #endif


More information about the cairo mailing list