// Copyright 1997-1998 Omni Development, Inc.  All rights reserved.

#import "OBUtilities.h"

#import <Foundation/Foundation.h>
#import <objc/objc-runtime.h>

#import "rcsid.h"

RCS_ID("$Header: /LocalDeveloper/Source/CVS/OmniGroup/OmniBase/OBUtilities.m,v 1.4 1998/01/12 06:53:10 kc Exp $")

void OBRequestConcreteImplementation(id self, SEL _cmd)
{
    [NSException raise:OBAbstractImplementation
     format:@"%@ needs a concrete implementation of %s", [self class], sel_getName(_cmd)];
}

void OBRejectUnusedImplementation(id self, SEL _cmd)
{
    [NSException raise:OBUnusedImplementation
     format:@"%c[%@ %s] should not be invoked",
     OBPointerIsClass(self) ? '+' : '-',
     OBClassForPointer(self), sel_getName(_cmd)];
}

DEFINE_NSSTRING(OBAbstractImplementation);
DEFINE_NSSTRING(OBUnusedImplementation);

// BSD stuff that NT doesn't have

#ifdef WIN32

#warning TJW - This probably does not meet the IEEE754 standard on rounding, but should be sufficient for us
double rint(double a)
{
    double c;

    c = ceil(a);
    if (c - a > 0.5)
        return c - 1.0;
    else
        return c;
}

#endif
