[cairo-commit] cairo-ocaml/src ml_cairo.c,1.8,1.9 ml_cairo_lablgtk.c,1.7,1.8 ml_cairo_wrappers.h,1.2,1.3
Olivier Andrieu
commit at pdx.freedesktop.org
Mon Aug 15 11:12:59 PDT 2005
Committed by: oandrieu
Update of /cvs/cairo/cairo-ocaml/src
In directory pdx:/tmp/cvs-serv20919/src
Modified Files:
ml_cairo.c ml_cairo_lablgtk.c ml_cairo_wrappers.h
Log Message:
use an Unsupported macro for unavailable functions
Index: ml_cairo.c
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ml_cairo.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** a/ml_cairo.c 27 Feb 2004 22:49:12 -0000 1.8
--- b/ml_cairo.c 27 Feb 2004 23:05:28 -0000 1.9
***************
*** 73,81 ****
}
#else
! CAMLprim value
! ml_cairo_set_target_ps(value v_cr, value v_file, value v_width_inches,
! value v_height_inches, value v_x_pixels_per_inch,
! value v_y_pixels_per_inch)
! { failwith("Cairo library does not support this backend") ; return Val_unit; }
#endif /* CAIRO_HAS_PS_SURFACE */
ML_bc6(cairo_set_target_ps)
--- 73,77 ----
}
#else
! Unsupported(ml_cairo_set_target_ps)
#endif /* CAIRO_HAS_PS_SURFACE */
ML_bc6(cairo_set_target_ps)
***************
*** 933,939 ****
ML_5(cairo_ps_surface_create, FILE_val, Double_val, Double_val, Double_val, Double_val, Val_cairo_surface_t)
#else
! CAMLprim value
! ml_cairo_ps_surface_create(value v1, value v2, value v3, value v4, value v5)
! { failwith("Cairo library does not support this backend") ; return Val_unit; }
#endif /* CAIRO_HAS_PS_SURFACE */
--- 929,933 ----
ML_5(cairo_ps_surface_create, FILE_val, Double_val, Double_val, Double_val, Double_val, Val_cairo_surface_t)
#else
! Unsupported(ml_cairo_ps_surface_create)
#endif /* CAIRO_HAS_PS_SURFACE */
***************
*** 1032,1040 ****
ML_4(cairo_png_surface_create, FILE_val, cairo_format_t_val, Double_val, Double_val, Val_cairo_surface_t)
#else
! CAMLprim value
! ml_cairo_set_target_png(value v_cr, value v_file, value v_format,
! value v_width, value v_height)
! { failwith("Cairo library does not support this backend") ; return Val_unit; }
! ml_cairo_png_surface_create(value v1, value v2, value v3, value v4, value v5)
! { failwith("Cairo library does not support this backend") ; return Val_unit; }
#endif /* CAIRO_HAS_PNG_SURFACE */
--- 1026,1030 ----
ML_4(cairo_png_surface_create, FILE_val, cairo_format_t_val, Double_val, Double_val, Val_cairo_surface_t)
#else
! Unsupported(ml_cairo_set_target_png)
! Unsupported(ml_cairo_png_surface_create)
#endif /* CAIRO_HAS_PNG_SURFACE */
Index: ml_cairo_lablgtk.c
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ml_cairo_lablgtk.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** a/ml_cairo_lablgtk.c 22 Feb 2004 22:41:26 -0000 1.7
--- b/ml_cairo_lablgtk.c 27 Feb 2004 23:05:28 -0000 1.8
***************
*** 117,127 ****
#else
! CAMLprim value
! cairo_lablgtk_surface_create_for_drawable(value d, value fmt)
! { failwith("Cairo library does not support this backend") ; return Val_unit; }
!
! CAMLprim value
! cairo_lablgtk_set_target_drawable(value cr, value d)
! { failwith("Cairo library does not support this backend") ; return Val_unit; }
#endif /* CAIRO_HAS_XLIB_SURFACE */
--- 117,122 ----
#else
! Unsupported(cairo_lablgtk_surface_create_for_drawable)
! Unsupported(cairo_lablgtk_set_target_drawable)
#endif /* CAIRO_HAS_XLIB_SURFACE */
Index: ml_cairo_wrappers.h
===================================================================
RCS file: /cvs/cairo/cairo-ocaml/src/ml_cairo_wrappers.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** a/ml_cairo_wrappers.h 22 Feb 2004 19:21:08 -0000 1.2
--- b/ml_cairo_wrappers.h 27 Feb 2004 23:05:28 -0000 1.3
***************
*** 28,31 ****
--- 28,34 ----
#define Unit(x) ((x), Val_unit)
+ #define Unsupported(fun) \
+ CAMLprim value fun() { failwith("Unsupported backend"); return Val_unit; }
+
#define ML_0(cname, conv) \
CAMLprim value ml_##cname (value unit) { return conv (cname ()); }
More information about the cairo-commit
mailing list