extern "C" stuff to support C++ (Fredrik Hglund)

This commit is contained in:
Carl Worth 2003-04-23 07:17:57 +00:00
parent 189b01b4fd
commit 5a4f65a774
3 changed files with 19 additions and 3 deletions

View file

@ -29,6 +29,14 @@
#include "pixregion.h"
#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
#define _ICFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
#define _ICFUNCPROTOEND }
#else
#define _ICFUNCPROTOBEGIN
#define _ICFUNCPROTOEND
#endif
/* icformat.c */
/* XXX: Change from int to enum for IcFormatName */
@ -45,6 +53,8 @@ typedef struct _IcFormat {
int alpha, alphaMask;
} IcFormat;
_ICFUNCPROTOBEGIN
void
IcFormatInit (IcFormat *format, IcFormatName name);
@ -192,4 +202,6 @@ IcComposite (char op,
int width,
int height);
_ICFUNCPROTOEND
#endif /* _IC_H_ */

View file

@ -31,6 +31,8 @@
typedef struct _XrState XrState;
typedef struct _XrSurface XrSurface;
_XFUNCPROTOBEGIN
/* Functions for manipulating state objects */
XrState *
XrCreate(void);
@ -112,7 +114,7 @@ typedef enum _XrOperator {
} XrOperator;
void
XrSetOperator(XrState *xrs, XrOperator operator);
XrSetOperator(XrState *xrs, XrOperator op);
void
XrSetRGBColor(XrState *xrs, double red, double green, double blue);
@ -349,5 +351,7 @@ XrSurfaceSetClipRegion (XrSurface *surface, Region region);
XrStatus
XrSurfaceSetRepeat (XrSurface *surface, int repeat);
_XFUNCPROTOEND
#endif

View file

@ -114,12 +114,12 @@ XrSetTargetDrawable (XrState *xrs,
}
void
XrSetOperator(XrState *xrs, XrOperator operator)
XrSetOperator(XrState *xrs, XrOperator op)
{
if (xrs->status)
return;
xrs->status = _XrGStateSetOperator(_XR_CURRENT_GSTATE(xrs), operator);
xrs->status = _XrGStateSetOperator(_XR_CURRENT_GSTATE(xrs), op);
}
void