Keeping it portable[message #101039]
|
Tue, 06 April 2004 07:04
|
|
PinkyAndThaBrain |
Messages:2
Registered:April 2004 |
|
|
Defining a few coding conventions about now would seem like a good idea ...
For instance always have a ANSI-C fallback of every function, and splitting off all assembly into external files for nasm? This is pretty much the gold standard for portable code with x86 assembly at the moment. If SDL is ever adopted this will make porting to *nix and OSX so much less painfull.
Inline assembly can be a little more efficient, but that advantage it is only really relevant for intrinsic type functions with very few actual instructions. Where that is relevant some macros with ifdef'd inline assembly can be used, but I dont see any such code.
Report message to a moderator
|
Civilian
|
|
|
|
Re: Keeping it portable[message #101041]
|
Wed, 07 April 2004 20:50
|
|
PinkyAndThaBrain |
Messages:2
Registered:April 2004 |
|
|
If you say now "we want our codebase to have assembly functions in nasm" someone might actually try his hand at that who might otherwise spend his time coding inline asm code for gcc (which would then give you huge unreadable source with lots of ifdef'd inline assembly functions). Now is the time to set some ground rules, not for the existing code ... but for new code, to prevent people from wasting time.
To give a concrete example, I think it would be a mistake to let GCC only C code get into the main branch ...
Report message to a moderator
|
Civilian
|
|
|
Re: Keeping it portable[message #101042]
|
Wed, 07 April 2004 21:00
|
|
Crimson Rider |
|
Messages:19
Registered:April 2004 Location: Netherlands |
|
|
I agree.
This is a good time to set some ground rules. The excisting code is as is. Can't change much about that.
But the future code, well need to agree on how to handle that.
Report message to a moderator
|
Private
|
|
|