home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Mail / mailapp-utilities-2.1-MIHS / Source / compat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-14  |  1.2 KB  |  54 lines

  1. /*+++*
  2.  *  title:    compat.h
  3.  *  abstract:    OPENSTEP/Rhapsody compatibility routines for mailapp-utilities. 
  4.  *  author:    Tom Hageman <tom@basil.icce.rug.nl>
  5.  *  created:    January 1998
  6.  *  modified:    (see RCS Log at end)
  7.  *  copyleft:
  8.  *
  9.  *    Copyright (C) 1998 Tom R. Hageman, but otherwise perfect freeware.
  10.  *
  11.  *  description:
  12.  *
  13.  *---*/
  14.  
  15. #ifdef RCS_compat_ID
  16. static const char * const RCS_h_id = ((void)&RCS_h_id,
  17.     "@(#)compat.h,v 1.2 1998/02/14 17:34:42");
  18. #endif
  19.  
  20. #if (!defined(NS_TARGET) && !defined(NeXT))
  21. #  warning Cannot determine NEXTSTEP/OPENSTEP/Rhapsody version.
  22. #elif (NS_TARGET < 40)
  23. #  define NEXTSTEP   1
  24. #elif (NS_TARGET <= 41)
  25. #  define OPENSTEP   1
  26. #else
  27. #  define RHAPSODY   1
  28. #endif
  29.  
  30. #if (OPENSTEP || RHAPSODY)
  31.  
  32. #import <Foundation/Foundation.h>
  33.  
  34. extern const char *NXGetDefaultValue(const char *owner, const char *name);
  35.  
  36. #  define POOL_INIT    id _pool = [[NSAutoreleasePool alloc] init];
  37. #  define POOL_RELEASE    [_pool release];
  38.  
  39. #  define ROOT_OBJECT    NSObject
  40. #  define FREE_OBJECT(o) [(o) release]
  41.  
  42. #else // NEXTSTEP
  43.  
  44. #import <objc/Object.h>
  45. #import <defaults/defaults.h>
  46.  
  47. #  define POOL_INIT
  48. #  define POOL_RELEASE
  49.  
  50. #  define ROOT_OBJECT    Object
  51. #  define FREE_OBJECT(0) [(o) free]
  52.  
  53. #endif
  54.