Re: [PATCH] Make use of .half and .asciiz assembler keywords when needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Costa wrote:

Hi,

AS provided in Sun Workshop Compilers
1) does not recognizes .short keyword but .half
2) .ascii creates string that does not contain the null character, .asciz does


Bye.
Christian.

Changelog:
Make use of .half and/or .asciiz assembler keywords when necessary.

Christian Costa titan.costa@wanadoo.fr

Please don't use my previous patch! Use this one instead.

Christian.

Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.134
diff -u -r1.134 configure.ac
--- configure.ac	21 Mar 2003 05:06:53 -0000	1.134
+++ configure.ac	22 Mar 2003 11:00:35 -0000
@@ -732,14 +732,32 @@
   AC_DEFINE([__ASM_NAME(name)], [name])
 fi
 
-dnl **** Check for .string in assembler ****
+dnl **** Check for .string then .asciz in assembler ****
 
 AC_CACHE_CHECK([whether assembler accepts .string], ac_cv_c_asm_string,
     WINE_TRY_ASM_LINK([".data\n\t.string \"test\"\n\t.text"],,,
                       ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no"))
 if test "$ac_cv_c_asm_string" = "yes"
 then
-  AC_DEFINE(HAVE_ASM_STRING, 1, [Define to use .string instead of .ascii])
+  AC_DEFINE(HAVE_ASM_STRING, 1, [Define to use .string instead of .asciz or .ascii])
+else
+    AC_CACHE_CHECK([whether assembler accepts .asciz], ac_cv_c_asm_asciz,
+        WINE_TRY_ASM_LINK([".data\n\t.asciz \"test\"\n\t.text"],,,
+                      ac_cv_c_asm_asciz="yes",ac_cv_c_asm_asciz="no"))
+    if test "$ac_cv_c_asm_asciz" = "yes"
+    then
+      AC_DEFINE(HAVE_ASM_ASCIZ, 1, [Define to use .asciz instead of .ascii])
+    fi					
+fi
+
+dnl **** Check for .short in assembler ****
+
+AC_CACHE_CHECK([whether assembler accepts .short], ac_cv_c_asm_short,
+    WINE_TRY_ASM_LINK([".data\n\t.short 1\n\t.text"],,,
+                      ac_cv_c_asm_short="yes",ac_cv_c_asm_short="no"))
+if test "$ac_cv_c_asm_short" = "yes"
+then
+  AC_DEFINE(HAVE_ASM_SHORT, 1, [Define to use .short instead of .half])
 fi
 
 dnl **** Check for working dll ****
Index: include/config.h.in
===================================================================
RCS file: /home/wine/wine/include/config.h.in,v
retrieving revision 1.143
diff -u -r1.143 config.h.in
--- include/config.h.in	20 Mar 2003 23:47:25 -0000	1.143
+++ include/config.h.in	22 Mar 2003 11:00:36 -0000
@@ -35,8 +35,14 @@
 /* Define if you have ARTS sound server */
 #undef HAVE_ARTS
 
-/* Define to use .string instead of .ascii */
+/* Define to use .string instead of .asciz or .ascii */
 #undef HAVE_ASM_STRING
+
+/* Define to use .asciiz instead of .ascii */
+#undef HAVE_ASM_ASCIZ
+
+/* Define to use .short instead of .half */
+#undef HAVE_ASM_SHORT
 
 /* Define to 1 if you have the <audio/audiolib.h> header file. */
 #undef HAVE_AUDIO_AUDIOLIB_H
Index: tools/winebuild/build.h
===================================================================
RCS file: /home/wine/wine/tools/winebuild/build.h,v
retrieving revision 1.41
diff -u -r1.41 build.h
--- tools/winebuild/build.h	18 Mar 2003 05:30:54 -0000	1.41
+++ tools/winebuild/build.h	22 Mar 2003 11:00:37 -0000
@@ -32,9 +32,17 @@
 #include <string.h>
 
 #ifdef HAVE_ASM_STRING
-# define STRING ".string"
+# define ASM_STRING ".string"
+#elif HAVE_ASM_ASCIZ
+# define ASM_STRING ".asciz"
 #else
-# define STRING ".ascii"
+# define ASM_STRING ".ascii"
+#endif
+
+#ifdef HAVE_ASM_SHORT
+# define ASM_SHORT ".short"
+#else
+# define ASM_SHORT ".half"
 #endif
 
 typedef enum
Index: tools/winebuild/spec32.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/spec32.c,v
retrieving revision 1.62
diff -u -r1.62 spec32.c
--- tools/winebuild/spec32.c	18 Mar 2003 05:30:54 -0000	1.62
+++ tools/winebuild/spec32.c	22 Mar 2003 11:00:39 -0000
@@ -210,7 +210,7 @@
         fprintf( outfile, "    \"\\t.text\\n\"\n" );
         fprintf( outfile, "    \"__wine_spec_exp_names:\\n\"\n" );
         for (i = 0; i < nb_names; i++)
-            fprintf( outfile, "    \"\\t" STRING " \\\"%s\\\"\\n\"\n", Names[i]->name );
+            fprintf( outfile, "    \"\\t" ASM_STRING " \\\"%s\\\"\\n\"\n", Names[i]->name );
         fprintf( outfile, "    \"\\t.data\\n\"\n" );
 
         /* output the function ordinals */
@@ -218,12 +218,12 @@
         fprintf( outfile, "    \"__wine_spec_exp_ordinals:\\n\"\n" );
         for (i = 0; i < nb_names; i++)
         {
-            fprintf( outfile, "    \"\\t.short %d\\n\"\n", Names[i]->ordinal - Base );
+            fprintf( outfile, "    \"\\t" ASM_SHORT " %d\\n\"\n", Names[i]->ordinal - Base );
         }
         total_size += nb_names * sizeof(short);
         if (nb_names % 2)
         {
-            fprintf( outfile, "    \"\\t.short 0\\n\"\n" );
+            fprintf( outfile, "    \"\\t" ASM_SHORT " 0\\n\"\n" );
             total_size += sizeof(short);
         }
     }
@@ -237,7 +237,7 @@
         {
             ORDDEF *odp = Ordinals[i];
             if (odp && (odp->flags & FLAG_FORWARD))
-                fprintf( outfile, "    \"\\t" STRING " \\\"%s\\\"\\n\"\n", odp->link_name );
+                fprintf( outfile, "    \"\\t" ASM_STRING " \\\"%s\\\"\\n\"\n", odp->link_name );
         }
         fprintf( outfile, "    \"\\t.align %d\\n\"\n", get_alignment(4) );
         total_size += (fwd_size + 3) & ~3;
@@ -281,7 +281,7 @@
             case TYPE_CDECL:
                 fprintf( outfile, "    \"\\tjmp " __ASM_NAME("%s") "\\n\"\n", name );
                 fprintf( outfile, "    \"\\tret\\n\"\n" );
-                fprintf( outfile, "    \"\\t.short %d\\n\"\n", args );
+                fprintf( outfile, "    \"\\t" ASM_SHORT " %d\\n\"\n", args );
                 fprintf( outfile, "    \"\\t.long " __ASM_NAME("%s") ",0x%08x\\n\"\n", name, mask );
                 break;
             default:

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux