[f-spot/FSPOT_0_6_0_STABLE] if gphoto2 > 2.4, bind gp_file_new_from_fd
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [f-spot/FSPOT_0_6_0_STABLE] if gphoto2 > 2.4, bind gp_file_new_from_fd
- Date: Fri, 25 Sep 2009 20:40:20 +0000 (UTC)
commit ad72ab2ac3292ee9cce45c271dd6e04e1060991e
Author: Stephane Delcroix <stephane delcroix org>
Date: Fri Sep 25 16:25:57 2009 +0200
if gphoto2 > 2.4, bind gp_file_new_from_fd
configure.ac | 7 ++++++-
lib/libgphoto2-sharp/CameraFile.cs | 17 +++++++++++++++++
lib/libgphoto2-sharp/Makefile.am | 2 +-
3 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9934d29..399ba6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,7 +125,6 @@ PKG_CHECK_MODULES(BEAGLE, beagle-0.0 >= $BEAGLE_REQUIRED,
AC_SUBST(BEAGLE_DIR)
AC_SUBST(LINK_BEAGLE)
-AC_SUBST(CSC_DEFINES)
dnl -- dbus-sharp: link or bundle ?
PKG_CHECK_MODULES(NDESK_DBUS, ndesk-dbus-1.0 >= $NDESK_DBUS_REQUIRED ndesk-dbus-glib-1.0 >= $NDESK_DBUS_GLIB_REQUIRED,
@@ -197,6 +196,12 @@ dnl --- libgphoto2-sharp
PKG_CHECK_MODULES(LIBGPHOTO2, libgphoto2 >= 2.1.4)
+if pkg-config --atleast-version=2.4 libgphoto2; then
+ CSC_DEFINES="$CSC_DEFINES -d:GPHOTO2_2_4"
+fi
+
+AC_SUBST(CSC_DEFINES)
+
dnl --- libexif version check
LIBEXIF_API_CHANGE=0.6.0
diff --git a/lib/libgphoto2-sharp/CameraFile.cs b/lib/libgphoto2-sharp/CameraFile.cs
index c93f0d5..eb8ca5f 100644
--- a/lib/libgphoto2-sharp/CameraFile.cs
+++ b/lib/libgphoto2-sharp/CameraFile.cs
@@ -4,6 +4,9 @@
* Author(s):
* Ewen Cheslack-Postava <echeslack gmail com>
* Larry Ewing <lewing novell com>
+ * Stephane Delcroix <stephane delcroix org>
+ *
+ * Copyright (c) 2005-2009 Novell, Inc.
*
* This is free software. See COPYING for details.
*/
@@ -51,6 +54,20 @@ namespace LibGPhoto2
this.handle = new HandleRef (this, native);
}
+#if GPHOTO2_2_4
+ [DllImport ("libgphoto2.so")]
+ internal static extern ErrorCode gp_file_new_from_fd (out IntPtr file, int fd);
+
+ public CameraFile(int fd)
+ {
+ IntPtr native;
+
+ Error.CheckError (gp_file_new_from_fd (out native, fd));
+
+ this.handle = new HandleRef (this, native);
+ }
+#endif
+
[DllImport ("libgphoto2.so")]
internal static extern ErrorCode gp_file_unref (HandleRef file);
diff --git a/lib/libgphoto2-sharp/Makefile.am b/lib/libgphoto2-sharp/Makefile.am
index 471f355..938b3e4 100644
--- a/lib/libgphoto2-sharp/Makefile.am
+++ b/lib/libgphoto2-sharp/Makefile.am
@@ -26,7 +26,7 @@ ASSEMBLY = $(ASSEMBLY_NAME).dll
all: $(ASSEMBLY)
$(ASSEMBLY): $(ASSEMBLY_SOURCES)
- $(CSC_LIB) -unsafe -out:$@ $(PKGS) $(REFS) $(ASSEMBLY_SOURCES)
+ $(CSC_LIB) $(CSC_DEFINES) -unsafe -out:$@ $(PKGS) $(REFS) $(ASSEMBLY_SOURCES)
assemblydir = $(pkglibdir)
assembly_DATA = \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]