Optimization.h

Go to the documentation of this file.
00001 
00002 /*  $Id: Optimization.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /*
00005 **  Apple Macintosh Developer Technical Support
00006 **
00007 **  DirectoryCopy: #defines that let you make MoreFiles code more efficient.
00008 **
00009 **  by Jim Luther, Apple Developer Technical Support Emeritus
00010 **
00011 **  File:       Optimization.h
00012 **
00013 **  Copyright  1992-1999 Apple Computer, Inc.
00014 **  All rights reserved.
00015 **
00016 **  You may incorporate this sample code into your applications without
00017 **  restriction, though the sample code has been provided "AS IS" and the
00018 **  responsibility for its operation is 100% yours.  However, what you are
00019 **  not permitted to do is to redistribute the source as "DSC Sample Code"
00020 **  after having made changes. If you're going to re-distribute the source,
00021 **  we require that you make it clear in the source that the code was
00022 **  descended from Apple Sample Code, but that you've made changes.
00023 **
00024 **  The Optimization changes to MoreFiles source and header files, along with
00025 **  this file and OptimizationEnd.h, let you optimize the code produced
00026 **  by MoreFiles in several ways.
00027 **
00028 **  1 -- MoreFiles contains extra code so that many routines can run under
00029 **  Mac OS systems back to System 6. If your program requires a specific
00030 **  version of Mac OS and your program checks for that version before
00031 **  calling MoreFiles routines, then you can remove a lot of compatibility
00032 **  code by defining one of the following to 1:
00033 **
00034 **      __MACOSSEVENFIVEONEORLATER  // assume Mac OS 7.5.1 or later
00035 **      __MACOSSEVENFIVEORLATER     // assume Mac OS 7.5 or later
00036 **      __MACOSSEVENORLATER         // assume Mac OS 7.0 or later
00037 **
00038 **  If you're compiling 68K code, the default is to include all compatibility code.
00039 **  If you're compiling PowerPC code (TARGET_RT_MAC_CFM), the default is __MACOSSEVENORLATER
00040 **  If you're compiling for Carbon code (TARGET_API_MAC_CARBON), the default is __MACOSSEVENFIVEONEORLATER
00041 **
00042 **  2 -- You may disable Pascal calling conventions in all MoreFiles routines
00043 **  except for system callbacks that require Pascal calling conventions.
00044 **  This will make 68K C programs both smaller and faster. 
00045 **  (PowerPC compilers ignore pascal calling conventions.)
00046 **  Just define __WANTPASCALELIMINATION to be 1 to turn this optimization on
00047 **  when building MoreFiles for use from C programs (you'll need to keep
00048 **  Pascal calling conventions when linking MoreFiles routines with Pascal
00049 **  programs).
00050 **
00051 **  3 -- If Metrowerks compiler is used, "#pragma internal on" may help produce
00052 **  better code. However, this option can also cause problems if you're
00053 **  trying to build MoreFiles as a shared library, so it is by default not used.
00054 **  Just define __USEPRAGMAINTERNAL to be 1 to turn this optimization on.
00055 **
00056 **  Original changes supplied by Fabrizio Oddone
00057 **
00058 **  File:   Optimization.h
00059 */
00060 
00061 #include <ConditionalMacros.h>
00062 
00063 // if we're compiling for Carbon, then we're running on Mac OS 8.1 or later
00064 #ifndef __MACOSSEVENFIVEONEORLATER
00065     #define __MACOSSEVENFIVEONEORLATER TARGET_API_MAC_CARBON
00066 #endif
00067 
00068 #ifndef __MACOSSEVENFIVEORLATER
00069     #define __MACOSSEVENFIVEORLATER __MACOSSEVENFIVEONEORLATER
00070 #endif
00071 
00072 #ifndef __MACOSSEVENORLATER
00073     #if TARGET_RT_MAC_CFM
00074         #define __MACOSSEVENORLATER 1
00075     #else
00076         #define __MACOSSEVENORLATER __MACOSSEVENFIVEORLATER
00077     #endif
00078 #endif
00079 
00080 
00081 #ifndef __WANTPASCALELIMINATION
00082     #define __WANTPASCALELIMINATION 0
00083 #endif
00084 
00085 #if __WANTPASCALELIMINATION
00086     #define pascal  
00087 #endif
00088 
00089 
00090 #ifndef __USEPRAGMAINTERNAL
00091     #define __USEPRAGMAINTERNAL 0
00092 #endif
00093 
00094 #if __USEPRAGMAINTERNAL
00095     #if defined(__MWERKS__)
00096         #pragma internal on
00097     #endif
00098 #endif
00099 

Generated on Wed May 31 18:19:57 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6