Ok so you can use ?IFDEF to define functions specifically for a device. Most of the time I use this for iOS plugins like the following:-
?IFDEF IPHONE
IMPORT "C" const char* DeviceName()
IMPORT "C" void EnableAutoLock(int value)
?ELSE
FUNCTION DeviceName%:
ENDFUNCTION
FUNCTION EnableAutoLock%: value%
ENDFUNCTION
?ENDIF
Ok that's fine. So if it's IPHONE it will do proper C calls, and otherwise it will do standard functions that return nothing (because the iOS functions don't relate to anything non-iOS).
But what happens if you have say code to do the same functionality for a different device? Ok you could use ?IFDEF again for each device, but the ?ELSE is gone out of the window surely (defined twice for the iPhone basically because is an ?ELSE on the other device)?
Ideally ?ELSEIF would be perfect (unless you handle all devices manually with ?IFDEF).
So let's say you had the code for the above function for IPHONE, WEBOS, and ANDROID (but NOTHING else), you would then have something like this:-
?IFDEF IPHONE
IMPORT "C" const char* DeviceName()
IMPORT "C" void EnableAutoLock(int value)
?ELSEIF WEBOS
Blah blah WEBOS specific code
?ELSEIF ANDROID
Blah blah ANDROID specific code
?ELSE
FUNCTION DeviceName%:
ENDFUNCTION
FUNCTION EnableAutoLock%: value%
ENDFUNCTION
?ENDIF
Good idea no? Unless I've missed something and someone can point me in the correct direction.
Cheers