Re: predefined macro iOS vs OS X

2013-08-18 Thread Marcel Weiher
On Aug 18, 2013, at 15:06 , Kyle Sluder wrote: > On Aug 18, 2013, at 6:28 AM, Marcel Weiher wrote: >> On Aug 17, 2013, at 19:01 , Jean-Daniel Dupas wrote: >> >>> You don't have to add explicit dependency to anything as NSGeometry.h >>> already does that for you. >>> Importing Foundation.h is

Re: predefined macro iOS vs OS X

2013-08-18 Thread Kyle Sluder
On Aug 18, 2013, at 6:28 AM, Marcel Weiher wrote: > On Aug 17, 2013, at 19:01 , Jean-Daniel Dupas wrote: > >> You don't have to add explicit dependency to anything as NSGeometry.h >> already does that for you. >> Importing Foundation.h is enough to use CGRect on both OS X and iOS. > > That wo

Re: predefined macro iOS vs OS X

2013-08-18 Thread Marcel Weiher
On Aug 17, 2013, at 19:01 , Jean-Daniel Dupas wrote: > Le 17 août 2013 à 17:55, Marcel Weiher a écrit : >> However…if you care as much about dependency management as I do (and chances >> are you don’t), and don’t have a direct dependency on CoreGraphics in that >> code (and chances are you do)

Re: predefined macro iOS vs OS X

2013-08-17 Thread Kyle Sluder
On Aug 17, 2013, at 4:52 PM, Clark Smith Cox III wrote: > On Aug 16, 2013, at 10:04, Kyle Sluder wrote: > >> Stop using NSRect in your method prototypes and just use CGRect. > > Or just define NS_BUILD_32_LIKE_64. Doing so will cause NSRect to be defined > as a typedef for CGRect. Gerriet st

Re: predefined macro iOS vs OS X

2013-08-17 Thread Clark Smith Cox III
On Aug 16, 2013, at 10:04, Kyle Sluder wrote: > On Aug 16, 2013, at 12:41 PM, "Gerriet M. Denkmann" > wrote: > >> >> On 16 Aug 2013, at 22:59, Kyle Sluder wrote: >> >>> >>> Xcode does know this. But if you're building for 32-bit OS X, it will >>> correctly complain. >> >> When I build f

Re: predefined macro iOS vs OS X

2013-08-17 Thread Maxthon Chan
Well I chose GNUstep for its longer history (it predates Cocoa, even OpenStep - in fact it is the second implementation of Application Kit, what would later become the libraries we now know as Foundation and AppKit, after NeXT.) and better ARC support. They have an impressive libobjc that combin

Re: predefined macro iOS vs OS X

2013-08-17 Thread Marcel Weiher
On Aug 17, 2013, at 18:03 , Maxthon Chan wrote: > On Aug 17, 2013, at 23:52, Marcel Weiher wrote: >> On Aug 16, 2013, at 19:04 , Kyle Sluder wrote: >> >>> Stop using NSRect in your method prototypes and just use CGRect. >> >> This is certainly pragmatic, effective advice. >> >> >> >> Howev

Re: predefined macro iOS vs OS X

2013-08-17 Thread Jean-Daniel Dupas
Le 17 août 2013 à 17:55, Marcel Weiher a écrit : > > On Aug 16, 2013, at 19:04 , Kyle Sluder wrote: > >> On Aug 16, 2013, at 12:41 PM, "Gerriet M. Denkmann" >> wrote: >>> On 16 Aug 2013, at 22:59, Kyle Sluder wrote: Xcode does know this. But if you're building for 32-bit OS X, it will

Re: predefined macro iOS vs OS X

2013-08-17 Thread Maxthon Chan
I actually got one step (sorry for the pun) ahead as limited to what Cocoa’s Foundation and GNUstep’s Base have in common. That allows me to create code-compatible programs that builds and runs under both OS X (or iOS) and Linux. (In my company everything starts off in Objective-C and now with t

Re: predefined macro iOS vs OS X

2013-08-17 Thread Marcel Weiher
On Aug 16, 2013, at 19:04 , Kyle Sluder wrote: > On Aug 16, 2013, at 12:41 PM, "Gerriet M. Denkmann" > wrote: >> On 16 Aug 2013, at 22:59, Kyle Sluder wrote: >>> Xcode does know this. But if you're building for 32-bit OS X, it will >>> correctly complain. >> >> When I build for Mac OS X CGR

Re: predefined macro iOS vs OS X

2013-08-17 Thread Marcel Weiher
On Aug 16, 2013, at 19:04 , Kyle Sluder wrote: > On Aug 16, 2013, at 12:41 PM, "Gerriet M. Denkmann" > wrote: >> On 16 Aug 2013, at 22:59, Kyle Sluder wrote: >>> Xcode does know this. But if you're building for 32-bit OS X, it will >>> correctly complain. >> >> When I build for Mac OS X CGR

Re: predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
On 17 Aug 2013, at 00:04, Kyle Sluder wrote: > On Aug 16, 2013, at 12:41 PM, "Gerriet M. Denkmann" > wrote: > >> >> On 16 Aug 2013, at 22:59, Kyle Sluder wrote: >> >>> >>> Xcode does know this. But if you're building for 32-bit OS X, it will >>> correctly complain. >> >> When I build fo

Re: predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
On 17 Aug 2013, at 01:33, Greg Parker wrote: > On Aug 16, 2013, at 5:10 AM, Gerriet M. Denkmann wrote: >> I have some code which is almost identical vor iOS and OS X. >> So I want to write something like: >> >> #ifdef SOME_THING >> // OS X >> NSRect someRect = ... >> #else >>

Re: predefined macro iOS vs OS X

2013-08-16 Thread Greg Parker
On Aug 16, 2013, at 5:10 AM, Gerriet M. Denkmann wrote: > I have some code which is almost identical vor iOS and OS X. > So I want to write something like: > > #ifdef SOME_THING > // OS X > NSRect someRect = ... > #else > // iOS > CGRect someRect =... > #endif > > Bu

Re: predefined macro iOS vs OS X

2013-08-16 Thread Kyle Sluder
On Aug 16, 2013, at 12:41 PM, "Gerriet M. Denkmann" wrote: > > On 16 Aug 2013, at 22:59, Kyle Sluder wrote: > >> >> Xcode does know this. But if you're building for 32-bit OS X, it will >> correctly complain. > > When I build for Mac OS X CGRect is accepted. > But when I build for iOS then

Re: predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
On 16 Aug 2013, at 22:59, Kyle Sluder wrote: > On Aug 16, 2013, at 9:51 AM, "Gerriet M. Denkmann" > wrote: > >> >> On 16 Aug 2013, at 19:17, Rick Mann wrote: >> >>> One thing to note: in the 64-bit run time, NSRect and CGRect are the same >>> thing. >> Yes. But the Xcode does not know thi

Re: predefined macro iOS vs OS X

2013-08-16 Thread Kyle Sluder
On Aug 16, 2013, at 9:51 AM, "Gerriet M. Denkmann" wrote: > > On 16 Aug 2013, at 19:17, Rick Mann wrote: > >> One thing to note: in the 64-bit run time, NSRect and CGRect are the same >> thing. > Yes. But the Xcode does not know this and creates lots of warnings. Xcode does know this. But if

Re: predefined macro iOS vs OS X

2013-08-16 Thread Jens Alfke
On Aug 16, 2013, at 6:51 AM, Gerriet M. Denkmann wrote: > Is this documented anywhere? Xcode seems not to know about this. Not sure where it is in the docs, but /usr/include/TargetConditionals.h, which defines this symbol and others, has a bunch of commentary. —Jens __

Re: predefined macro iOS vs OS X

2013-08-16 Thread Maxthon Chan
Well I’d go with a conditional like: #if TARGET_OS_IPHONE typedef CGRect NSRect; typedef CGSize NSSize; typedef CGPoint NSPoint; #define NSMakeRect CGRectMake #define NSMakePoint CGPointMake // etc #endif and go with NS* variants. On Aug 16, 2013, at 20:17, Rick Mann wrote: > One thing to

Re: predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
On 16 Aug 2013, at 19:17, Rick Mann wrote: > One thing to note: in the 64-bit run time, NSRect and CGRect are the same > thing. Yes. But the Xcode does not know this and creates lots of warnings. > > Otherwise, what you want is > > #if TARGET_OS_IPHONE Very good. Just tried it, and it works

Re: predefined macro iOS vs OS X

2013-08-16 Thread Rick Mann
One thing to note: in the 64-bit run time, NSRect and CGRect are the same thing. Otherwise, what you want is #if TARGET_OS_IPHONE or #if !TARGET_OS_IPHONE On Aug 16, 2013, at 05:10 , Gerriet M. Denkmann wrote: > I have some code which is almost identical vor iOS and OS X. > So I want to wr

predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
I have some code which is almost identical vor iOS and OS X. So I want to write something like: #ifdef SOME_THING // OS X NSRect someRect = ... #else // iOS CGRect someRect =... #endif But what to choose for SOME_THING? Gerriet. _