GNUStep Macros

From GNUstepWiki

(Difference between revisions)
Revision as of 21:32, 14 July 2012
Awiebe (Talk | contribs)

← Previous diff
Current revision
Awiebe (Talk | contribs)

Line 1: Line 1:
 +
 +
 +==GCC==
 +
 +==Platform Dependant==
 +*ifdef __MINGW__ /*do*/ #endif Windows POSIX
 +
 +==Memory Managment==
 +
 +* RETAIN(x) Bump the retain cound of x where x does not inherit from NSObject. As in foundation objects.
 +* RELEASE(x) Decrement the retain count of X
 +* AUTORELEASE(x)
* ASSIGN(object,value) to assign an object variable, performing the appropriate re- tain/release as necessary. * ASSIGN(object,value) to assign an object variable, performing the appropriate re- tain/release as necessary.
* ASSIGNCOPY(object,value) to copy the value and assign it to the object. * ASSIGNCOPY(object,value) to copy the value and assign it to the object.
Line 9: Line 21:
*#ifndef _WIN64 if not 64-bit windows *#ifndef _WIN64 if not 64-bit windows
*GS_WITH_GC is gnustep && has garbage collection *GS_WITH_GC is gnustep && has garbage collection
- 
-==GCC== 
- 
-==Platform Dependant== 
-*ifdef __MINGW__ /*do*/ #endif Windows POSIX 
- 
-==Memory Managment== 
- 
-*RETAIN(x) Bump the retain cound of x where x does not inherit from NSObject. As in foundation objects. 
-*RELEASE(x) Decrement the retain count of X 

Current revision


Contents

GCC

Platform Dependant

  • ifdef __MINGW__ /*do*/ #endif Windows POSIX

Memory Managment

  • RETAIN(x) Bump the retain cound of x where x does not inherit from NSObject. As in foundation objects.
  • RELEASE(x) Decrement the retain count of X
  • AUTORELEASE(x)
  • ASSIGN(object,value) to assign an object variable, performing the appropriate re- tain/release as necessary.
  • ASSIGNCOPY(object,value) to copy the value and assign it to the object.
  • DESTROY(object) to release an object variable and set it to nil.
  • CREATE AUTORELEASE POOL(name) to create an autorelease pool with the spec- ified name.
  • IF NO GC(X) compile the code ’X’ only if GarbageCollection is not in use.
  • #ifdef __OBJC_GC__ /*Code*/ #endif If garbage collection is on then include, otherwise skip.
  • __weak This object is weak, if nothing references it, it will be collected.
    1. ifndef _WIN64 if not 64-bit windows
  • GS_WITH_GC is gnustep && has garbage collection


Misc