+2007-12-03 Helge Hess <me@helgehess.eu>
+
+ * NGExtensions/NSString+Formatting.h: replaced usage of deprecated
+ -getCString: method on MacOS 10.4 and later (v4.7.196)
+
2007-07-31 Marcus Mueller <znek@mulle-kybernetik.com>
* FdExt.subproj/NSMethodSignature+misc.m: added warning and bogus
- implementation of -objCTypes for Leopard
+ implementation of -objCTypes for Leopard (v4.7.195)
2007-05-31 Helge Hess <helge.hess@opengroupware.org>
/*
- Copyright (C) 2000-2005 SKYRIX Software AG
+ Copyright (C) 2000-2007 SKYRIX Software AG
+ Copyright (C) 2007 Helge Hess
This file is part of SOPE.
// C support functions
static inline int
-xs_vsnprintf(char *str, size_t max, const char *fmt, va_list _ap)
+xs_vsnprintf(char *_str, size_t max, const char *fmt, va_list _ap)
{
- NSString *obj = [NSString stringWithCFormat:str arguments:_ap];
- [obj getCString:str maxLength:(max - 1)];
+ NSString *obj = [NSString stringWithCFormat:_str arguments:_ap];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+ [obj getCString:_str maxLength:(max - 1)
+ encoding:[NSString defaultCStringEncoding]];
+ return strlen(_str);
+#else
+ [obj getCString:_str maxLength:(max - 1)];
return [obj cStringLength]; // return the len the string would have consumed
+#endif
}
static inline int xs_vsprintf (char *_str, const char *_fmt, va_list _ap) {
NSString *obj = [NSString stringWithCFormat:_str arguments:_ap];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+ [obj getCString:_str maxLength:65535 /* no limit ... */
+ encoding:[NSString defaultCStringEncoding]];
+ return strlen(_str);
+#else
[obj getCString:_str];
return [obj cStringLength]; // return the length of the string
+#endif
}
/*