diff --git a/CHANGES b/CHANGES index 8bef6dd8e..f05b6ce3c 100644 --- a/CHANGES +++ b/CHANGES @@ -3,7 +3,7 @@ * "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. +* __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!! diff --git a/output/outaout.c b/output/outaout.c index 495e9ac7c..18746e373 100644 --- a/output/outaout.c +++ b/output/outaout.c @@ -877,7 +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'", + "%define __NASM_FORMAT__ 'aout'", "%macro __NASM_CDecl__ 1", "%endmacro", NULL diff --git a/output/outas86.c b/output/outas86.c index b623a15b2..ccf87e7fa 100644 --- a/output/outas86.c +++ b/output/outas86.c @@ -555,7 +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'", + "%define __NASM_FORMAT__ 'as86'", "%macro __NASM_CDecl__ 1", "%endmacro", NULL diff --git a/output/outbin.c b/output/outbin.c index 72821ffde..3f63d4ce3 100644 --- a/output/outbin.c +++ b/output/outbin.c @@ -137,7 +137,7 @@ static char *infile, *outfile; static const char *bin_stdmac[] = { "%define __SECT__ [section .text]", - "%define _NASM_FORMAT_ 'bin'", + "%define __NASM_FORMAT__ 'bin'", "%imacro org 1+.nolist", "[org %1]", "%endmacro", diff --git a/output/outcoff.c b/output/outcoff.c index 655e3fc05..bd0202f2a 100644 --- a/output/outcoff.c +++ b/output/outcoff.c @@ -820,7 +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'", + "%define __NASM_FORMAT__ 'coff'", "%macro __NASM_CDecl__ 1", "%endmacro", "%imacro export 1+.nolist", diff --git a/output/outelf.c b/output/outelf.c index 276feac06..bff9405d0 100644 --- a/output/outelf.c +++ b/output/outelf.c @@ -1225,7 +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'", + "%define __NASM_FORMAT__ 'elf'", "%macro __NASM_CDecl__ 1", "%define $_%1 $%1", "%endmacro", diff --git a/output/outobj.c b/output/outobj.c index 188ff73e6..a3eed140a 100644 --- a/output/outobj.c +++ b/output/outobj.c @@ -2285,7 +2285,7 @@ void obj_fwrite(ObjRecord *orp) static const char *obj_stdmac[] = { "%define __SECT__ [section .text]", - "%define _NASM_FORMAT_ 'obj'", + "%define __NASM_FORMAT__ 'obj'", "%imacro group 1+.nolist", "[group %1]", "%endmacro", diff --git a/output/outrdf.c b/output/outrdf.c index 6ae492ea5..32e63bca5 100644 --- a/output/outrdf.c +++ b/output/outrdf.c @@ -501,7 +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 */ + "%define __NASM_FORMAT__ 'oldrdf'", /* Its always oldrdf for consistency with rdf version 2 */ "%imacro library 1+.nolist", "[library %1]", "%endmacro", diff --git a/output/outrdf2.c b/output/outrdf2.c index 8fdf6a444..3c69e0a30 100644 --- a/output/outrdf2.c +++ b/output/outrdf2.c @@ -753,7 +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'", + "%define __NASM_FORMAT__ 'rdf'", "%imacro library 1+.nolist", "[library %1]", "%endmacro", diff --git a/test/nasmformat.asm b/test/nasmformat.asm index decf090ee..82d61c152 100644 --- a/test/nasmformat.asm +++ b/test/nasmformat.asm @@ -1,9 +1,9 @@ -%if _NASM_FORMAT_ == 'bin' +%if __NASM_FORMAT__ == 'bin' db 'This is binary format file' -%elif _NASM_FORMAT_ == 'obj' +%elif __NASM_FORMAT__ == 'obj' db 'This is object format file'