mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 17:51:01 +00:00
(Apple-compatible). This is currently slow, because we go via NSInvocation. We could probably make it faster, but I am not inclined to optimise for something that I sincerely hope is a very unusual use case. Richard: Please check I haven't done something silly here... git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31411 72102866-910b-0410-8b05-ffd578937521
25 lines
502 B
C
25 lines
502 B
C
#define INTEGER_MACRO(encoding, type, name, ignored) \
|
|
- (type) name ## Value\
|
|
{\
|
|
return (type)VALUE;\
|
|
}
|
|
#include "GSNumberTypes.h"
|
|
- (BOOL) boolValue
|
|
{
|
|
return (VALUE == 0) ? NO : YES;
|
|
}
|
|
- (const char *) objCType
|
|
{
|
|
return @encode(typeof(VALUE));
|
|
}
|
|
- (NSString*) descriptionWithLocale: (id)aLocale
|
|
{
|
|
return [[[NSString alloc] initWithFormat: FORMAT
|
|
locale: aLocale, VALUE] autorelease];
|
|
}
|
|
- (void) getValue: (void*)buffer
|
|
{
|
|
typeof(VALUE) *ptr = buffer;
|
|
*ptr = VALUE;
|
|
}
|
|
#undef FORMAT
|