PATCH: asm -> __asm__

Marcus Meissner meissner at suse.de
Fri Apr 15 08:33:47 CDT 2005


Hi,

We should be using the __asm__ version instead of the asm just in case
someone passes -ansi or similar to us.

Ciao, Marcus

Changelog:
	Replace asm() by __asm__() in generated files, the asm
	symbol does not exist in -pedantic or -ansi.

Index: tools/winebuild/import.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/import.c,v
retrieving revision 1.72
diff -u -r1.72 import.c
--- tools/winebuild/import.c	9 Feb 2005 14:06:32 -0000	1.72
+++ tools/winebuild/import.c	15 Apr 2005 13:32:13 -0000
@@ -691,7 +691,7 @@
     fprintf( outfile, "#ifndef __GNUC__\nstatic void __asm__dummy_import(void) {\n#endif\n\n" );
     pos = (sizeof(void *) + 2*sizeof(unsigned int) + sizeof(const char *) + sizeof(void *)) *
             (nb_imm + 1);  /* offset of imports.data from start of imports */
-    fprintf( outfile, "asm(\".text\\n\\t.align %d\\n\"\n", get_alignment(8) );
+    fprintf( outfile, "__asm__(\".text\\n\\t.align %d\\n\"\n", get_alignment(8) );
     fprintf( outfile, "    \"" __ASM_NAME("%s") ":\\n\"\n", import_thunks);
 
     for (i = 0; i < nb_imports; i++)
@@ -891,7 +891,7 @@
     fprintf( outfile, "static void __asm__dummy_delay_import(void) {\n" );
     fprintf( outfile, "#endif\n" );
 
-    fprintf( outfile, "asm(\".align %d\\n\"\n", get_alignment(8) );
+    fprintf( outfile, "__asm__(\".align %d\\n\"\n", get_alignment(8) );
     fprintf( outfile, "    \"" __ASM_NAME("%s") ":\\n\"\n", delayed_import_loaders);
     fprintf( outfile, "    \"\\t" __ASM_FUNC("__wine_delay_load_asm") "\\n\"\n" );
     fprintf( outfile, "    \"" __ASM_NAME("__wine_delay_load_asm") ":\\n\"\n" );
Index: tools/winebuild/spec32.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/spec32.c,v
retrieving revision 1.86
diff -u -r1.86 spec32.c
--- tools/winebuild/spec32.c	15 Mar 2005 15:42:32 -0000	1.86
+++ tools/winebuild/spec32.c	15 Apr 2005 13:32:13 -0000
@@ -89,7 +89,7 @@
     fprintf( outfile, "#else\n" );
     fprintf( outfile, "extern %s %s(%s);\n", ret_type, name, params );
     fprintf( outfile, "static void __asm__dummy_%s(void)", name );
-    fprintf( outfile, " { asm(\".weak " __ASM_NAME("%s") "\"); }\n", name );
+    fprintf( outfile, " { __asm__(\".weak " __ASM_NAME("%s") "\"); }\n", name );
     fprintf( outfile, "#endif\n\n" );
 }
 
@@ -134,7 +134,7 @@
 
     if (!nr_exports) return 0;
 
-    fprintf( outfile, "asm(\".data\\n\"\n" );
+    fprintf( outfile, "__asm__(\".data\\n\"\n" );
     fprintf( outfile, "    \"\\t.align %d\\n\"\n", get_alignment(4) );
     fprintf( outfile, "    \"" __ASM_NAME("__wine_spec_exports") ":\\n\"\n" );
 
@@ -384,7 +384,7 @@
         if (odp->flags & FLAG_FORWARD) continue;
         name = make_internal_name( odp, spec, "regs" );
         fprintf( outfile,
-                 "asm(\".align %d\\n\\t\"\n"
+                 "__asm__(\".align %d\\n\\t\"\n"
                  "    \"" __ASM_FUNC("%s") "\\n\\t\"\n"
                  "    \"" __ASM_NAME("%s") ":\\n\\t\"\n"
                  "    \"call " __ASM_NAME("__wine_call_from_32_regs") "\\n\\t\"\n"
@@ -412,27 +412,27 @@
 #if defined(__i386__)
     if (constructor)
     {
-        fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
         fprintf( outfile, "    \"\\tcall " __ASM_NAME("%s") "\\n\"\n", constructor );
         fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
     }
     if (destructor)
     {
-        fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
         fprintf( outfile, "    \"\\tcall " __ASM_NAME("%s") "\\n\"\n", destructor );
         fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
     }
 #elif defined(__sparc__)
     if (constructor)
     {
-        fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
         fprintf( outfile, "    \"\\tcall " __ASM_NAME("%s") "\\n\"\n", constructor );
         fprintf( outfile, "    \"\\tnop\\n\"\n" );
         fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
     }
     if (destructor)
     {
-        fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
         fprintf( outfile, "    \"\\tcall " __ASM_NAME("%s") "\\n\"\n", destructor );
         fprintf( outfile, "    \"\\tnop\\n\"\n" );
         fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
@@ -442,14 +442,14 @@
 /* Mach-O doesn't have an init section */
     if (constructor)
     {
-        fprintf( outfile, "asm(\"\\t.mod_init_func\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.mod_init_func\\n\"\n" );
         fprintf( outfile, "    \"\\t.align 2\\n\"\n" );
         fprintf( outfile, "    \"\\t.long " __ASM_NAME("%s") "\\n\"\n", constructor );
         fprintf( outfile, "    \"\\t.text\\n\");\n" );
     }
     if (destructor)
     {
-        fprintf( outfile, "asm(\"\\t.mod_term_func\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.mod_term_func\\n\"\n" );
         fprintf( outfile, "    \"\\t.align 2\\n\"\n" );
         fprintf( outfile, "    \"\\t.long " __ASM_NAME("%s") "\\n\"\n", destructor );
         fprintf( outfile, "    \"\\t.text\\n\");\n" );
@@ -457,13 +457,13 @@
 # else /* __APPLE__ */
     if (constructor)
     {
-        fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
         fprintf( outfile, "    \"\\tbl " __ASM_NAME("%s") "\\n\"\n", constructor );
         fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
     }
     if (destructor)
     {
-        fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
         fprintf( outfile, "    \"\\tbl " __ASM_NAME("%s") "\\n\"\n", destructor );
         fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
     }
@@ -471,13 +471,13 @@
 #elif defined(__ALPHA__)
     if (constructor)
     {
-        fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
         fprintf( outfile, "    \"\\tjsr $26," __ASM_NAME("%s") "\\n\"\n", constructor );
         fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
     }
     if (destructor)
     {
-        fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
+        fprintf( outfile, "__asm__(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
         fprintf( outfile, "    \"\\tjsr $26," __ASM_NAME("%s") "\\n\"\n", destructor );
         fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
     }
@@ -526,7 +526,7 @@
     fprintf( outfile, "#ifndef __GNUC__\n" );
     fprintf( outfile, "static void __asm__dummy_header(void) {\n" );
     fprintf( outfile, "#endif\n" );
-    fprintf( outfile, "asm(\".text\\n\\t\"\n" );
+    fprintf( outfile, "__asm__(\".text\\n\\t\"\n" );
     fprintf( outfile, "    \".align %d\\n\"\n", get_alignment(page_size) );
     fprintf( outfile, "    \"" __ASM_NAME("__wine_spec_pe_header") ":\\t" __ASM_SKIP " 65536\\n\\t\"\n" );
     fprintf( outfile, "    \".data\\n\\t\"\n" );
@@ -953,13 +953,13 @@
              prefix, prefix );
 
 #if defined(__i386__)
-    fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
+    fprintf( outfile, "__asm__(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
     fprintf( outfile, "    \"\\tcall " __ASM_NAME("__wine_dbg_%s_init") "\\n\"\n", prefix );
     fprintf( outfile, "    \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
     fprintf( outfile, "    \"\\tcall " __ASM_NAME("__wine_dbg_%s_fini") "\\n\"\n", prefix );
     fprintf( outfile, "    \"\\t.section\\t\\\".text\\\"\\n\");\n" );
 #elif defined(__sparc__)
-    fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
+    fprintf( outfile, "__asm__(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
     fprintf( outfile, "    \"\\tcall " __ASM_NAME("__wine_dbg_%s_init") "\\n\"\n", prefix );
     fprintf( outfile, "    \"\\tnop\\n\"\n" );
     fprintf( outfile, "    \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
@@ -968,23 +968,23 @@
     fprintf( outfile, "    \"\\t.section\t\\\".text\\\"\\n\");\n" );
 #elif defined(__powerpc__)
 # ifdef __APPLE__
-	fprintf( outfile, "asm(\"\\t.mod_init_func\\n\"\n" );
+	fprintf( outfile, "__asm__(\"\\t.mod_init_func\\n\"\n" );
 	fprintf( outfile, "    \"\\t.align 2\\n\"\n" );
 	fprintf( outfile, "    \"\\t.long " __ASM_NAME("__wine_dbg_%s_init") "\\n\"\n", prefix );
 	fprintf( outfile, "    \"\\t.text\\n\");\n" );
-	fprintf( outfile, "asm(\"\\t.mod_term_func\\n\"\n" );
+	fprintf( outfile, "__asm__(\"\\t.mod_term_func\\n\"\n" );
 	fprintf( outfile, "    \"\\t.align 2\\n\"\n" );
 	fprintf( outfile, "    \"\\t.long " __ASM_NAME("__wine_dbg_%s_fini") "\\n\"\n", prefix );
 	fprintf( outfile, "    \"\\t.text\\n\");\n" );
 # else
-    fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
+    fprintf( outfile, "__asm__(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
     fprintf( outfile, "    \"\\tbl " __ASM_NAME("__wine_dbg_%s_init") "\\n\"\n", prefix );
     fprintf( outfile, "    \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
     fprintf( outfile, "    \"\\tbl " __ASM_NAME("__wine_dbg_%s_fini") "\\n\"\n", prefix );
     fprintf( outfile, "    \"\\t.text\\n\");\n" );
 # endif
 #elif defined(__ALPHA__)
-    fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
+    fprintf( outfile, "__asm__(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
     fprintf( outfile, "    \"\\tjsr $26," __ASM_NAME("__wine_dbg_%s_init") "\\n\"\n", prefix );
     fprintf( outfile, "    \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
     fprintf( outfile, "    \"\\tjsr $26," __ASM_NAME("__wine_dbg_%s_fini") "\\n\"\n", prefix );
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050415/077e0da3/attachment.pgp


More information about the wine-patches mailing list