Enabled VPATH feature: changed nearly all Makefiles (149 files).
[fw/sdcc] / support / regression / tests / libmullong.c
index 61ead68b4212cda24ecc0559781fb0b96c77aa61..a469b93af99936c2528ed1042359fff2620f75c1 100644 (file)
@@ -7,45 +7,58 @@
 #define type_{type}
 
 #if defined(PORT_HOST)
-#  include "../../../../../sdccconf.h"
+#  include "sdccconf.h"
+#  define mullong(a,b) mullong_wrapper(a,b)
 #  if defined(type_c) && !defined(WORDS_BIGENDIAN)
 #    define _SDCC_NO_ASM_LIB_FUNCS 1
 #    define near
 #    define long int
-#    include "../../../../../device/lib/_mullong.c"
-#    define mullong(a,b) mullong_wrapper(a,b)
-#  else
-#    define mullong(a,b) (a*b)
+#    include "device/lib/_mullong.c"
 #  endif
 #else
 #  if defined(type_c)
 #    define _SDCC_NO_ASM_LIB_FUNCS 1
 #  endif
-#  include "../../../../../device/lib/_mullong.c"
+#  include "device/lib/_mullong.c"
 #  define mullong _mullong
 #endif
 
 /* gcc 2.95.2 on usf-cf-x86-linux-1 (debian 2.2) has a bug with
  * packing structs
  */
-#if defined(PORT_HOST) && defined(type_c) && !defined(WORDS_BIGENDIAN)
+#if defined(PORT_HOST)
+
+#if defined(type_c) && !defined(WORDS_BIGENDIAN)
 struct
 {
   char c1;
   short i;
   char c2;
 } pack_test;
-       
-long
-mullong_wrapper (long a, long b)
+
+TYPE_DWORD
+mullong_wrapper (TYPE_DWORD a, TYPE_DWORD b)
 {
   if (sizeof(pack_test) == 4)
     /* length of struct ok: use SDCC library */
     return _mullong (a, b);
   else
-    /* buggy gcc: use generic multiplication */
+    {
+      /* buggy gcc: use generic multiplication */
+      return a * b;
+    }
+}
+
+#else
+
+TYPE_DWORD
+mullong_wrapper (TYPE_DWORD a, TYPE_DWORD b)
+{
     return a * b;
 }
+
+#endif
+
 #endif
 
 void