Added _NASM_FORMAT_ macro

This commit is contained in:
Stanislav Karchebny 2003-09-24 10:30:56 +00:00
parent f3b3ce27bd
commit 88a049aca1
10 changed files with 26 additions and 0 deletions

View file

@ -3,6 +3,10 @@
* "make spotless" no longer deletes config.h.in.
* Unterminated string auto termination.
* %(el)if(n)idn insensitivity to string quotes difference (#809300).
* _NASM_FORMAT_ now gives output format chosen for compiling.
See test/nasmformat.asm for details and output/out*.c for actual values
for this macro.
!!NEEDS DOCUMENTING!!
0.98.38
-------

View file

@ -877,6 +877,7 @@ static void aout_filename (char *inname, char *outname, efunc error)
static const char *aout_stdmac[] = {
"%define __SECT__ [section .text]",
"%define _NASM_FORMAT_ 'aout'",
"%macro __NASM_CDecl__ 1",
"%endmacro",
NULL

View file

@ -555,6 +555,7 @@ static void as86_filename (char *inname, char *outname, efunc error)
static const char *as86_stdmac[] = {
"%define __SECT__ [section .text]",
"%define _NASM_FORMAT_ 'as86'",
"%macro __NASM_CDecl__ 1",
"%endmacro",
NULL

View file

@ -137,6 +137,7 @@ static char *infile, *outfile;
static const char *bin_stdmac[] = {
"%define __SECT__ [section .text]",
"%define _NASM_FORMAT_ 'bin'",
"%imacro org 1+.nolist",
"[org %1]",
"%endmacro",

View file

@ -820,6 +820,7 @@ static void coff_win32_filename (char *inname, char *outname, efunc error)
static const char *coff_stdmac[] = {
"%define __SECT__ [section .text]",
"%define _NASM_FORMAT_ 'coff'",
"%macro __NASM_CDecl__ 1",
"%endmacro",
"%imacro export 1+.nolist",

View file

@ -1225,6 +1225,7 @@ static void elf_filename (char *inname, char *outname, efunc error)
static const char *elf_stdmac[] = {
"%define __SECT__ [section .text]",
"%define _NASM_FORMAT_ 'elf'",
"%macro __NASM_CDecl__ 1",
"%define $_%1 $%1",
"%endmacro",

View file

@ -2285,6 +2285,7 @@ void obj_fwrite(ObjRecord *orp)
static const char *obj_stdmac[] = {
"%define __SECT__ [section .text]",
"%define _NASM_FORMAT_ 'obj'",
"%imacro group 1+.nolist",
"[group %1]",
"%endmacro",

View file

@ -501,6 +501,7 @@ static void rdf_filename (char *inname, char *outname, efunc error) {
static char *rdf_stdmac[] = {
"%define __SECT__ [section .text]",
"%define _NASM_FORMAT_ 'oldrdf'", /* Its always oldrdf for consistency with rdf version 2 */
"%imacro library 1+.nolist",
"[library %1]",
"%endmacro",

View file

@ -753,6 +753,7 @@ static void rdf2_filename (char *inname, char *outname, efunc error) {
static const char *rdf2_stdmac[] = {
"%define __SECT__ [section .text]",
"%define _NASM_FORMAT_ 'rdf'",
"%imacro library 1+.nolist",
"[library %1]",
"%endmacro",

14
test/nasmformat.asm Normal file
View file

@ -0,0 +1,14 @@
%if _NASM_FORMAT_ == 'bin'
db 'This is binary format file'
%elif _NASM_FORMAT_ == 'obj'
db 'This is object format file'
%else
db 'This is some other format file'
%endif