From a619cd8d71c97aa08948174ee4fddb4cb2b4f365 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Mon, 18 Jul 2011 02:50:02 +0200 Subject: [PATCH] Return OSXFUSE version if function "const char *macfuse_version(void)" of libmacfuse is invoked --- libmacfuse.xcodeproj/project.pbxproj | 5 +++-- libmacfuse/macfuse.c | 13 ++++++++----- libmacfuse/macfuse.h | 5 ----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/libmacfuse.xcodeproj/project.pbxproj b/libmacfuse.xcodeproj/project.pbxproj index 21ca445..f3f6cec 100644 --- a/libmacfuse.xcodeproj/project.pbxproj +++ b/libmacfuse.xcodeproj/project.pbxproj @@ -268,7 +268,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.5; ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = "-D__FreeBSD__=10"; + OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-L/tmp/osxfuse-core-10.5-2.1.7/pkgroot/usr/local/lib", "-L$(OSXFUSE_BUILD_ROOT)/usr/local/lib", @@ -285,12 +285,13 @@ DYLIB_COMPATIBILITY_VERSION = 10; DYLIB_CURRENT_VERSION = 2; GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_VERSION = 4.2; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.5; - OTHER_CFLAGS = "-D__FreeBSD__=10"; + OTHER_CFLAGS = ""; OTHER_LDFLAGS = ( "-L/tmp/osxfuse-core-10.5-2.1.7/pkgroot/usr/local/lib", "-L$(OSXFUSE_BUILD_ROOT)/usr/local/lib", diff --git a/libmacfuse/macfuse.c b/libmacfuse/macfuse.c index a4c2633..7b94e8a 100644 --- a/libmacfuse/macfuse.c +++ b/libmacfuse/macfuse.c @@ -10,12 +10,15 @@ #include "macfuse.h" -__attribute__((constructor)) static void lib_constructor(void); +extern void osxfuse_enable_macfuse_mode(bool); +extern const char *osxfuse_version(void); -const char *macfuse_version(void) { - return MACFUSE_VERSION; -} +__attribute__((constructor)) static void libmacfuse_constructor(void); -static void lib_constructor(void) { +static void libmacfuse_constructor(void) { osxfuse_enable_macfuse_mode(true); } + +const char *macfuse_version(void) { + return osxfuse_version(); +} diff --git a/libmacfuse/macfuse.h b/libmacfuse/macfuse.h index 54ee3e8..e525d84 100644 --- a/libmacfuse/macfuse.h +++ b/libmacfuse/macfuse.h @@ -8,9 +8,4 @@ #include -#define MACFUSE_VERSION "2.1.5" - const char *macfuse_version(void); - -// Enable or disable the MacFUSE compatibility mode -void osxfuse_enable_macfuse_mode(bool); \ No newline at end of file