TARGET_OS_IPHONE |
Owen Alanzo Hogarth
Guest
|
I can find this in the sdl source code but nothing similar for android. Is there a define for android?
|
|||||||||||
|
TARGET_OS_IPHONE |
DLudwig
|
__ANDROID__ gets #define'd to 1 on Android, by SDL 2.x, via the public header, SDL_platform.h.
There's a bunch of similar platform-specific #defines in there, too. To note, TARGET_OS_IPHONE is not SDL specific, but is one of Apple + iOS' own platform declaration macros. If I remember correctly, SDL uses it under the hood to define __IPHONEOS__ (which gets #define'd for any version of iOS, not just those running on phone hardware). -- David L. On Mon, Oct 5, 2015 at 7:09 AM, Owen Alanzo Hogarth wrote:
|
|||||||||||||
|
TARGET_OS_IPHONE |
Alex Szpakowski
Guest
|
Indeed. Check out the SDL_platform.h header to see what SDL defines on various platforms:
https://bitbucket.org/slime73/sdl-experiments/src/1fdb63e14757e2ea0a20b11c73d79fe8bb897919/include/SDL_platform.h?at=AppleTV&fileviewer=file-view-default
|
|||||||||||||||
|
TARGET_OS_IPHONE |
Owen Alanzo Hogarth
Guest
|
I noticed these, the reason I asked is because after only including SDL.h I could only use #define _TARGET_OS_IPHONE__ but not ANDROID or __ANDROID__
getting lint errors about __ANDROID__ Â not being defined. On Tue, Oct 6, 2015 at 3:43 AM, Alex Szpakowski wrote:
|
|||||||||||||||||
|
TARGET_OS_IPHONE |
DLudwig
|
My understanding of how SDL_platform.h (which is #include'd indirectly by SDL.h) works, at least on Android, is that it looks for the presence of macros that would typically be #define'd either by the compiler, or by part of the OS' own SDK(s).
Maybe lint is doing something that causes these macro(s) to break? That's just a guess, though. I'm not sure what's up with using lint in Android code, alongside SDL 2.x. Perhaps someone else knows, though. -- David L. On Mon, Oct 5, 2015 at 8:18 PM, Owen Alanzo Hogarth wrote:
|
|||||||||||||||||||
|
TARGET_OS_IPHONE |
Owen Alanzo Hogarth
Guest
|
I looked in SDL_platforms before mailing the list. I see that __ANDROID__ and ANDROID is defined in there, I am just unsure why it's causing issues in my code.
The lint is throwing up a warning but things compile fine, I really wish this would go away as it's a big eye sore working with vim and it's constantly highlighted. On Wed, Oct 7, 2015 at 1:04 AM, David Ludwig wrote:
|
|||||||||||||||||||||
|
TARGET_OS_IPHONE |
Owen Alanzo Hogarth
Guest
|
I might be able to solve this issue a different way.
I am just trying to find if this instance of SDL is being ran on mobile or desktop platform. Is there a standard way to find out is the app being run on mobile or desktop w/o using those statements? On Wed, Oct 7, 2015 at 11:10 AM, Owen Alanzo Hogarth wrote:
|
|||||||||||||||||||||||
|
Re: TARGET_OS_IPHONE |