jonof / jfbuild

Port of the Build game engine by Ken Silverman
http://www.jonof.id.au/jfbuild
Other
101 stars 29 forks source link

NASM has a --prefix flag so your underscores macro is unneeded #3

Closed Ericson2314 closed 11 years ago

Ericson2314 commented 11 years ago

Taken from http://www.nasm.us/doc/nasmdoc2.html

2.1.27 The --prefix and --postfix Options.

The --prefix and --postfix options prepend or append (respectively) the given argument to all global or extern variables. E.g. --prefix _ will prepend the underscore to all global and external variables, as C sometimes (but not always) likes it.

This is probably a cleaner way to do things.

jonof commented 11 years ago

Thanks for the heads-up. It looks like those options were not well (at all?) documented in the earlier versions of NASM that I was using early in development. Things are a bit cleaner now thanks to this (commit 061c46ff3013bb3c518c393b32d2a57c8f8a905b).

Ericson2314 commented 11 years ago

Glad to help. I only know because I went through the exact same procedure of starting with a macro and then finding the nasm flag (probably by accident) later while porting Voxlap. [And while I bring it up, if you have any suggestions on porting that, I'd love to here them. My port is at https://github.com/Ericson2314/Voxlap .]