Page 1 of 1

[Your Thoughts] Macros for Cross-Platform API Functionality

Posted: Fri Feb 11, 2011 1:26 pm
by Env
Wondering what you think of this idea...

Having a code library, which is designed to provide procedures and macros that will provide access to alternatives to each OS's API functions.


For instance;

Windows SetProp_(), would have a standard procedure name like 'SetProperty(...)' and in-code it would compile a version designed for each OS, be it Linux (g_object_set_property), or Mac (...)..


I know some API features in Windows may not exist in Linux, or Mac, but if a suitable work-around can be written as an alternative, it should provide a much wider function list that can be used in PureBasic regardless of OS.



Env

Re: [Your Thoughts] Macros for Cross-Platform API Alternativ

Posted: Sat Feb 12, 2011 9:12 pm
by Zach
Sounds like a neat idea to me!

Would make cross-platform development a lot easier too.

Although such a project would be a HUGE undertaking.. You'd need to decide what core components you are going to support, and as your list grows you have to constantly maintain it to keep up with changes in PB Syntax, as well as OS API

Re: [Your Thoughts] Macros for Cross-Platform API Alternativ

Posted: Wed Feb 16, 2011 1:08 am
by Env
Aye, no doubt it will be a long time, and a lot of work hours before a complete library can be completed, which in a sense will be never with changes always being made,

but if it were an opensource project, and available via SVN, it may be useful for some, and people can always contribute their own features.

Re: [Your Thoughts] Macros for Cross-Platform API Functional

Posted: Wed Feb 16, 2011 8:27 pm
by Suirad
Now you see the process required from the pb devs to add thing to purebasic itself. Essentially all pb commands are macros that change depending on the compilers os. If there is a good general knowledge of each os' api it shouldnt be too difficult depending on what commands your wanting to have

Re: [Your Thoughts] Macros for Cross-Platform API Functional

Posted: Wed Feb 16, 2011 10:22 pm
by Env
Yeah I know that to be the case, and with this, it may encourage, and assist the PBDevies to add more functionality.


If enough people are interested, I can set up a base for it, and a website for people to contribute their own code to provide a standard function/macro that will perform the same operation using the independent OS' API.