bug-prolog
[Top][All Lists]
Advanced

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

Re: Unable to simply compile gprolog


From: Salvador Abreu
Subject: Re: Unable to simply compile gprolog
Date: Fri, 7 May 2004 19:37:48 +0100

Apparently both gcc 3.3.3 and gcc 3.4.0 (but not 3.3.2) are a bit
stricter on declarations; they assume that __attribute(...)__ must occur
in the function definition as well as in the forward declarations.

Apply the attached patch and it should work (tested on Debian sid w/ gcc
3.4.0).  Patch relative to today's CVS.

This will make it into Debian shortly as gprolog_1.2.18-10.

(you may safely ignore the "watermark" patch)

Regards,
--
 ../salvador

--- ../gprolog-cvs/src/src/./BipsPl/arith_inl_c.c       2004-04-19 
12:31:15.000000000 +0100
+++ src/src/./BipsPl/arith_inl_c.c      2004-05-07 19:18:42.000000000 +0100
@@ -172,7 +172,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Math_Load_Value(WamWord start_word, WamWord *word_adr)
 {
   WamWord word, tag_mask;
@@ -193,7 +193,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Math_Fast_Load_Value(WamWord start_word, WamWord *word_adr)
 {
   WamWord word, tag_mask;
@@ -406,28 +406,28 @@
 
          /* fast-math version */
 
-WamWord
+WamWord FC
 Fct_Fast_Neg(WamWord x)
 {
   long vx = UnTag_INT(x);
   return Tag_INT(-vx);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Inc(WamWord x)
 {
   long vx = UnTag_INT(x);
   return Tag_INT(vx + 1);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Dec(WamWord x)
 {
   long vx = UnTag_INT(x);
   return Tag_INT(vx - 1);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Add(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -435,7 +435,7 @@
   return Tag_INT(vx + vy);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Sub(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -443,7 +443,7 @@
   return Tag_INT(vx - vy);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Mul(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -451,7 +451,7 @@
   return Tag_INT(vx * vy);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Div(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -463,7 +463,7 @@
   return Tag_INT(vx / vy);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Rem(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -475,7 +475,7 @@
   return Tag_INT(vx % vy);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Mod(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -493,32 +493,32 @@
   return Tag_INT(m);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_And(WamWord x, WamWord y)
 {
   return x & y;
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Or(WamWord x, WamWord y)
 {
   return x | y;
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Xor(WamWord x, WamWord y)
 {
   return (x ^ y) | TAG_INT_MASK;
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Not(WamWord x)
 {
   long vx = UnTag_INT(x);
   return Tag_INT(~vx);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Shl(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -526,7 +526,7 @@
   return Tag_INT(vx << vy);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Shr(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -534,14 +534,14 @@
   return Tag_INT(vx >> vy);
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Abs(WamWord x)
 {
   long vx = UnTag_INT(x);
   return (vx < 0) ? Tag_INT(-vx) : x;
 }
 
-WamWord
+WamWord FC
 Fct_Fast_Sign(WamWord x)
 {
   long vx = UnTag_INT(x);
@@ -552,115 +552,115 @@
 
          /* standard version */
 
-WamWord
+WamWord FC
 Fct_Neg(WamWord x)
 {
   IFtoIF(x, C_Neg, Fct_Fast_Neg);
 }
 
-WamWord
+WamWord FC
 Fct_Inc(WamWord x)
 {
   IFtoIF(x, DInc, Fct_Fast_Inc);
 }
 
-WamWord
+WamWord FC
 Fct_Dec(WamWord x)
 {
   IFtoIF(x, DDec, Fct_Fast_Dec);
 }
 
-WamWord
+WamWord FC
 Fct_Add(WamWord x, WamWord y)
 {
   IFxIFtoIF(x, y, C_Add, Fct_Fast_Add);
 }
 
-WamWord
+WamWord FC
 Fct_Sub(WamWord x, WamWord y)
 {
   IFxIFtoIF(x, y, C_Sub, Fct_Fast_Sub);
 }
 
-WamWord
+WamWord FC
 Fct_Mul(WamWord x, WamWord y)
 {
   IFxIFtoIF(x, y, C_Mul, Fct_Fast_Mul);
 }
 
-WamWord
+WamWord FC
 Fct_Div(WamWord x, WamWord y)
 {
   IxItoI(x, y, Fct_Fast_Div);
 }
 
-WamWord
+WamWord FC
 Fct_Float_Div(WamWord x, WamWord y)
 {
   IFxIFtoF(x, y, C_Div);
 }
 
-WamWord
+WamWord FC
 Fct_Rem(WamWord x, WamWord y)
 {
   IxItoI(x, y, Fct_Fast_Rem);
 }
 
-WamWord
+WamWord FC
 Fct_Mod(WamWord x, WamWord y)
 {
   IxItoI(x, y, Fct_Fast_Mod);
 }
 
-WamWord
+WamWord FC
 Fct_And(WamWord x, WamWord y)
 {
   IxItoI(x, y, Fct_Fast_And);
 }
 
-WamWord
+WamWord FC
 Fct_Or(WamWord x, WamWord y)
 {
   IxItoI(x, y, Fct_Fast_Or);
 }
 
-WamWord
+WamWord FC
 Fct_Xor(WamWord x, WamWord y)
 {
   IxItoI(x, y, Fct_Fast_Xor);
 }
 
-WamWord
+WamWord FC
 Fct_Not(WamWord x)
 {
   ItoI(x, Fct_Fast_Not);
 }
 
-WamWord
+WamWord FC
 Fct_Shl(WamWord x, WamWord y)
 {
   IxItoI(x, y, Fct_Fast_Shl);
 }
 
-WamWord
+WamWord FC
 Fct_Shr(WamWord x, WamWord y)
 {
   IxItoI(x, y, Fct_Fast_Shr);
 }
 
-WamWord
+WamWord FC
 Fct_Abs(WamWord x)
 {
   IFtoIF(x, fabs, Fct_Fast_Abs);
 }
 
-WamWord
+WamWord FC
 Fct_Sign(WamWord x)
 {
   IFtoIF(x, DSign, Fct_Fast_Sign);
 }
 
-WamWord
+WamWord FC
 Fct_Min(WamWord x, WamWord y)
 {
   double dx = To_Double(x);
@@ -675,7 +675,7 @@
   return Tag_Is_INT(x) ? x : y;
 }
 
-WamWord
+WamWord FC
 Fct_Max(WamWord x, WamWord y)
 {
   double dx = To_Double(x);
@@ -690,103 +690,103 @@
   return Tag_Is_INT(x) ? x : y;
 }
 
-WamWord
+WamWord FC
 Fct_Pow(WamWord x, WamWord y)
 {
   IFxIFtoF(x, y, pow);
 }
 
-WamWord
+WamWord FC
 Fct_Sqrt(WamWord x)
 {
   IFtoF(x, sqrt);
 }
 
-WamWord
+WamWord FC
 Fct_Atan(WamWord x)
 {
   IFtoF(x, atan);
 }
 
-WamWord
+WamWord FC
 Fct_Cos(WamWord x)
 {
   IFtoF(x, cos);
 }
 
-WamWord
+WamWord FC
 Fct_Acos(WamWord x)
 {
   IFtoF(x, acos);
 }
 
-WamWord
+WamWord FC
 Fct_Sin(WamWord x)
 {
   IFtoF(x, sin);
 }
 
-WamWord
+WamWord FC
 Fct_Asin(WamWord x)
 {
   IFtoF(x, asin);
 }
 
-WamWord
+WamWord FC
 Fct_Exp(WamWord x)
 {
   IFtoF(x, exp);
 }
 
-WamWord
+WamWord FC
 Fct_Log(WamWord x)
 {
   IFtoF(x, log);
 }
 
-WamWord
+WamWord FC
 Fct_Float(WamWord x)
 {
   IFtoF(x, Identity);
 }
 
-WamWord
+WamWord FC
 Fct_Ceiling(WamWord x)
 {
   FtoI(x, ceil);
 }
 
-WamWord
+WamWord FC
 Fct_Floor(WamWord x)
 {
   FtoI(x, floor);
 }
 
-WamWord
+WamWord FC
 Fct_Round(WamWord x)
 {
   FtoI(x, rint);
 }
 
-WamWord
+WamWord FC
 Fct_Truncate(WamWord x)
 {
   FtoI(x, Identity);
 }
 
-WamWord
+WamWord FC
 Fct_Float_Fract_Part(WamWord x)
 {
   FtoF(x, DFract);
 }
 
-WamWord
+WamWord FC
 Fct_Float_Integ_Part(WamWord x)
 {
   FtoF(x, DInteg);
 }
 
-WamWord
+WamWord FC
 Fct_Identity(WamWord x)
 {
   return x;
@@ -803,19 +803,19 @@
 
          /* fast-math version */
 
-Bool
+Bool FC
 Blt_Fast_Eq(WamWord x, WamWord y)
 {
   return x == y;
 }
 
-Bool
+Bool FC
 Blt_Fast_Neq(WamWord x, WamWord y)
 {
   return x != y;
 }
 
-Bool
+Bool FC
 Blt_Fast_Lt(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -823,7 +823,7 @@
   return vx < vy;
 }
 
-Bool
+Bool FC
 Blt_Fast_Lte(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -831,7 +831,7 @@
   return vx <= vy;
 }
 
-Bool
+Bool FC
 Blt_Fast_Gt(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -839,7 +839,7 @@
   return vx > vy;
 }
 
-Bool
+Bool FC
 Blt_Fast_Gte(WamWord x, WamWord y)
 {
   long vx = UnTag_INT(x);
@@ -850,32 +850,32 @@
 
          /* standard version */
 
-Bool
+Bool FC
 Blt_Eq(WamWord x, WamWord y)
 {
   Cmp_IFxIF(x, y, ==, Blt_Fast_Eq);
 }
-Bool
+Bool FC
 Blt_Neq(WamWord x, WamWord y)
 {
   Cmp_IFxIF(x, y, !=, Blt_Fast_Neq);
 }
-Bool
+Bool FC
 Blt_Lt(WamWord x, WamWord y)
 {
   Cmp_IFxIF(x, y, <, Blt_Fast_Lt);
 }
-Bool
+Bool FC
 Blt_Lte(WamWord x, WamWord y)
 {
   Cmp_IFxIF(x, y, <=, Blt_Fast_Lte);
 }
-Bool
+Bool FC
 Blt_Gt(WamWord x, WamWord y)
 {
   Cmp_IFxIF(x, y, >, Blt_Fast_Gt);
 }
-Bool
+Bool FC
 Blt_Gte(WamWord x, WamWord y)
 {
   Cmp_IFxIF(x, y, >=, Blt_Fast_Gte);
--- ../gprolog-cvs/src/src/./BipsPl/error_supp.c        2004-04-19 
12:31:16.000000000 +0100
+++ src/src/./BipsPl/error_supp.c       2004-05-07 19:16:20.000000000 +0100
@@ -278,7 +278,7 @@
  * SET_C_BIP_NAME                                                          *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Set_C_Bip_Name(char *func_str, int arity)
 {
   c_bip_func_str = func_str;
--- ../gprolog-cvs/src/src/./BipsPl/g_var_inl_c.c       2004-04-19 
12:31:17.000000000 +0100
+++ src/src/./BipsPl/g_var_inl_c.c      2004-05-07 19:20:36.000000000 +0100
@@ -58,7 +58,7 @@
 
 typedef struct                 /* Global variable element        */
 {                              /* ------------------------------ */
-  int size;                    /* <0:-array dim, 0:link, >0:copy */
+  long size;                   /* <0:-array dim, 0:link, >0:copy */
   WamWord val;                 /* ptr to GVarElt or term or adr  */
   PGUndo undo;                 /* ptr to 1st undo for this elem  */
 }
@@ -179,7 +179,7 @@
  * BLT_G_ASSIGN                                                            *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Blt_G_Assign(WamWord x, WamWord y)
 {
   Set_C_Bip_Name("g_assign", 2);
@@ -194,7 +194,7 @@
  * BLT_G_ASSIGNB                                                           *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Blt_G_Assignb(WamWord x, WamWord y)
 {
   Set_C_Bip_Name("g_assignb", 2);
@@ -209,7 +209,7 @@
  * BLT_G_LINK                                                              *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Blt_G_Link(WamWord x, WamWord y)
 {
   Set_C_Bip_Name("g_link", 2);
@@ -224,7 +224,7 @@
  * BLT_G_READ                                                              *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Read(WamWord x, WamWord y)
 {
   Bool res;
@@ -242,7 +242,7 @@
  * BLT_G_ARRAY_SIZE                                                        *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Array_Size(WamWord x, WamWord y)
 {
   Bool res;
@@ -260,7 +260,7 @@
  * BLT_G_INC                                                               *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Blt_G_Inc(WamWord x)
 {
   Set_C_Bip_Name("g_inc", 1);
@@ -275,7 +275,7 @@
  * BLT_G_INCO                                                              *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Inco(WamWord x, WamWord y)
 {
   Bool res;
@@ -293,7 +293,7 @@
  * BLT_G_INC_2                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Inc_2(WamWord x, WamWord y)
 {
   Bool res;
@@ -311,7 +311,7 @@
  * BLT_G_INC_3                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Inc_3(WamWord x, WamWord y, WamWord z)
 {
   Bool res;
@@ -329,7 +329,7 @@
  * BLT_G_DEC                                                               *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Blt_G_Dec(WamWord x)
 {
   Set_C_Bip_Name("g_dec", 1);
@@ -344,7 +344,7 @@
  * BLT_G_DECO                                                              *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Deco(WamWord x, WamWord y)
 {
   Bool res;
@@ -362,7 +362,7 @@
  * BLT_G_DEC_2                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Dec_2(WamWord x, WamWord y)
 {
   Bool res;
@@ -380,7 +380,7 @@
  * BLT_G_DEC_3                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Dec_3(WamWord x, WamWord y, WamWord z)
 {
   Bool res;
@@ -398,7 +398,7 @@
  * BLT_G_SET_BIT                                                           *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Blt_G_Set_Bit(WamWord x, WamWord y)
 {
   Set_C_Bip_Name("g_set_bit", 2);
@@ -413,7 +413,7 @@
  * BLT_G_RESET_BIT                                                         *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Blt_G_Reset_Bit(WamWord x, WamWord y)
 {
   Set_C_Bip_Name("g_reset_bit", 2);
@@ -428,7 +428,7 @@
  * BLT_G_TEST_SET_BIT                                                      *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Test_Set_Bit(WamWord x, WamWord y)
 {
   Bool res;
@@ -446,7 +446,7 @@
  * BLT_G_TEST_RESET_BIT                                                    *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_G_Test_Reset_Bit(WamWord x, WamWord y)
 {
   Bool res;
--- ../gprolog-cvs/src/src/./BipsPl/term_inl_c.c        2004-04-19 
12:31:18.000000000 +0100
+++ src/src/./BipsPl/term_inl_c.c       2004-05-07 19:19:39.000000000 +0100
@@ -56,7 +56,7 @@
  * BLT_TERM_EQ                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Term_Eq(WamWord x, WamWord y)
 {
   return Term_Compare(x, y) == 0;
@@ -69,7 +69,7 @@
  * BLT_TERM_NEQ                                                            *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Term_Neq(WamWord x, WamWord y)
 {
   return Term_Compare(x, y) != 0;
@@ -82,7 +82,7 @@
  * BLT_TERM_LT                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Term_Lt(WamWord x, WamWord y)
 {
   return Term_Compare(x, y) < 0;
@@ -95,7 +95,7 @@
  * BLT_TERM_LTE                                                            *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Term_Lte(WamWord x, WamWord y)
 {
   return Term_Compare(x, y) <= 0;
@@ -108,7 +108,7 @@
  * BLT_TERM_GT                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Term_Gt(WamWord x, WamWord y)
 {
   return Term_Compare(x, y) > 0;
@@ -121,7 +121,7 @@
  * BLT_TERM_GTE                                                            *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Term_Gte(WamWord x, WamWord y)
 {
   return Term_Compare(x, y) >= 0;
@@ -134,7 +134,7 @@
  * BLT_COMPARE                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Compare(WamWord cmp_word, WamWord x, WamWord y)
 {
   int cmp;
@@ -160,7 +160,7 @@
  * BLT_ARG                                                                 *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Arg(WamWord arg_no_word, WamWord term_word, WamWord sub_term_word)
 {
   WamWord *arg_adr;
@@ -185,7 +185,7 @@
  * BLT_FUNCTOR                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Functor(WamWord term_word, WamWord functor_word, WamWord arity_word)
 {
   WamWord word, tag_mask;
@@ -266,7 +266,7 @@
  * BLT_UNIV                                                                *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Univ(WamWord term_word, WamWord list_word)
 {
   WamWord word, tag_mask;
@@ -428,7 +428,7 @@
  * COPY_TERM_2                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Copy_Term_2(WamWord u_word, WamWord v_word)
 {
   WamWord word;
@@ -454,7 +454,7 @@
  * SETARG_4                                                                *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Setarg_4(WamWord arg_no_word, WamWord term_word, WamWord new_value_word,
         WamWord undo_word)
 {
@@ -490,7 +490,7 @@
  * TERM_REF_2                                                              *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Term_Ref_2(WamWord term_word, WamWord ref_word)
 {
   WamWord word, tag_mask;
--- ../gprolog-cvs/src/src/./BipsPl/type_inl_c.c        2004-04-19 
12:31:19.000000000 +0100
+++ src/src/./BipsPl/type_inl_c.c       2004-05-07 19:19:11.000000000 +0100
@@ -87,79 +87,79 @@
 
 
 
-Bool
+Bool FC
 Blt_Var(WamWord x)
 {
   Type_Test(Tag_Is_Var, x);
 }
 
-Bool
+Bool FC
 Blt_Non_Var(WamWord x)
 {
   Type_Test(Tag_Is_Nonvar, x);
 }
 
-Bool
+Bool FC
 Blt_Atom(WamWord x)
 {
   Type_Test(Tag_Is_Atom, x);
 }
 
-Bool
+Bool FC
 Blt_Integer(WamWord x)
 {
   Type_Test(Tag_Is_Integer, x);
 }
 
-Bool
+Bool FC
 Blt_Float(WamWord x)
 {
   Type_Test(Tag_Is_Float, x);
 }
 
-Bool
+Bool FC
 Blt_Number(WamWord x)
 {
   Type_Test(Tag_Is_Number, x);
 }
 
-Bool
+Bool FC
 Blt_Atomic(WamWord x)
 {
   Type_Test(Tag_Is_Atomic, x);
 }
 
-Bool
+Bool FC
 Blt_Compound(WamWord x)
 {
   Type_Test(Tag_Is_Compound, x);
 }
 
-Bool
+Bool FC
 Blt_Callable(WamWord x)
 {
   Type_Test(Tag_Is_Callable, x);
 }
 
-Bool
+Bool FC
 Blt_Fd_Var(WamWord x)
 {
   Type_Test(Tag_Is_Fd_Var, x);
 }
 
-Bool
+Bool FC
 Blt_Non_Fd_Var(WamWord x)
 {
   Type_Test(Tag_Is_Non_Fd_Var, x);
 }
 
-Bool
+Bool FC
 Blt_Generic_Var(WamWord x)
 {
   Type_Test(Tag_Is_Generic_Var, x);
 }
 
-Bool
+Bool FC
 Blt_Non_Generic_Var(WamWord x)
 {
   Type_Test(Tag_Is_Non_Generic_Var, x);
@@ -172,7 +172,7 @@
  * BLT_LIST                                                                *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_List(WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -198,7 +198,7 @@
  * BLT_PARTIAL_LIST                                                        *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_Partial_List(WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -224,7 +224,7 @@
  * BLT_LIST_OR_PARTIAL_LIST                                                *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Blt_List_Or_Partial_List(WamWord start_word)
 {
   WamWord word, tag_mask;
--- ../gprolog-cvs/src/src/./EnginePl/atom.c    2004-04-19 12:31:21.000000000 
+0100
+++ src/src/./EnginePl/atom.c   2004-05-07 19:15:32.000000000 +0100
@@ -225,7 +225,7 @@
  * CREATE_ALLOCATE_ATOM                                                    *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-int
+int FC
 Create_Allocate_Atom(char *name)
 {
   AtomInf *patom;
@@ -252,7 +252,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-int
+int FC
 Create_Atom(char *name)
 {
   AtomInf *patom;
@@ -346,7 +346,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Create_Atom_Tagged(char *name)
 {
   return Tag_ATM(Create_Atom(name));
@@ -360,7 +360,7 @@
  *                                                                         *
  * return the atom key or -1 if not exist.                                 *
  *-------------------------------------------------------------------------*/
-int
+int FC
 Find_Atom(char *name)
 {
   AtomInf *patom;
@@ -450,7 +450,7 @@
  * Find a new atom (gensym) beginning by a given prefix.                   *
  * hash<0 for any input or the index of the free atom to produce.          *
  *-------------------------------------------------------------------------*/
-int
+int FC
 Gen_New_Atom(char *prefix, int hash)
 {
   AtomInf *patom;
@@ -532,7 +532,7 @@
  *                                                                         *
  * returns the atom next after 'last_atom' (-1 to start) or -1 at the end  *
  *-------------------------------------------------------------------------*/
-int
+int FC
 Find_Next_Atom(int last_atom)
 {
   while (++last_atom < MAX_ATOM)
--- ../gprolog-cvs/src/src/./EnginePl/pred.c    2004-04-19 12:31:22.000000000 
+0100
+++ src/src/./EnginePl/pred.c   2004-05-07 19:16:01.000000000 +0100
@@ -73,7 +73,7 @@
  * Called by compiled prolog code, by dynamic predicate support and by     *
  * byte-code support.                                                      *
  *-------------------------------------------------------------------------*/
-PredInf *
+PredInf * FC
 Create_Pred(int func, int arity, int pl_file, int pl_line, int prop,
            long *codep)
 {
@@ -107,7 +107,7 @@
  * LOOKUP_PRED                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-PredInf *
+PredInf * FC
 Lookup_Pred(int func, int arity)
 {
   long key = Functor_Arity(func, arity);
@@ -122,7 +122,7 @@
  * DELETE_PRED                                                             *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Delete_Pred(int func, int arity)
 {
   long key = Functor_Arity(func, arity);
--- ../gprolog-cvs/src/src/./EnginePl/unify.c   2004-04-19 12:31:22.000000000 
+0100
+++ src/src/./EnginePl/unify.c  2004-05-07 19:13:07.000000000 +0100
@@ -33,7 +33,7 @@
  *    - to define the Unify function (classical unification).              *
  *    - to define the Unify_Occurs_Check function (+ occurs check).        *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 UNIFY_FCT_NAME(WamWord start_u_word, WamWord start_v_word)
 {
   WamWord u_word, u_tag_mask;
--- ../gprolog-cvs/src/src/./EnginePl/wam_inst.c        2004-04-19 
12:31:22.000000000 +0100
+++ src/src/./EnginePl/wam_inst.c       2004-05-07 19:12:07.000000000 +0100
@@ -68,7 +68,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Create_Functor_Arity_Tagged(char *func_str, int arity)
 {
   int func = Create_Atom(func_str);
@@ -85,7 +85,7 @@
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
 
-SwtTbl
+SwtTbl FC
 Create_Swt_Table(int size)
 {
   SwtTbl t;
@@ -105,7 +105,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Create_Swt_Atm_Element(SwtTbl t, int size, int atom, CodePtr codep)
 {
   SwtInf *swt = Locate_Swt_Element(t, size, atom);
@@ -122,7 +122,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Create_Swt_Stc_Element(SwtTbl t, int size, int func, int arity,
                       CodePtr codep)
 {
@@ -176,7 +176,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_Atom_Tagged(WamWord w, WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -199,7 +199,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_Atom(int atom, WamWord start_word)
 {
   return Get_Atom_Tagged(Tag_ATM(atom), start_word);
@@ -213,7 +213,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_Integer_Tagged(WamWord w, WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -241,7 +241,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_Integer(long n, WamWord start_word)
 {
   return Get_Integer_Tagged(Tag_INT(n), start_word);
@@ -255,7 +255,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_Float(double n, WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -279,7 +279,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_Nil(WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -302,7 +302,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_List(WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -332,7 +332,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_Structure_Tagged(WamWord w, WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -371,7 +371,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Get_Structure(int func, int arity, WamWord start_word)
 {
   return Get_Structure_Tagged(Functor_Arity(func, arity), start_word);
@@ -385,7 +385,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_X_Variable(void)
 {
   WamWord res_word;
@@ -406,7 +406,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Y_Variable(WamWord *y_adr)
 {
   return *y_adr = Make_Self_Ref(y_adr);
@@ -420,7 +420,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Unsafe_Value(WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -448,7 +448,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Atom_Tagged(WamWord w)
 {
   return w;
@@ -462,7 +462,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Atom(int atom)
 {
   return Tag_ATM(atom);
@@ -476,7 +476,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Integer_Tagged(WamWord w)
 {
   return w;
@@ -490,7 +490,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Integer(long n)
 {
   return Tag_INT(n);
@@ -504,7 +504,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Float(double n)
 {
   WamWord res_word;
@@ -522,7 +522,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Nil(void)
 {
   return NIL_WORD;
@@ -536,7 +536,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_List(void)
 {
   S = WRITE_MODE;
@@ -551,7 +551,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Structure_Tagged(WamWord w)
 {
   WamWord *cur_H = H;
@@ -569,7 +569,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Put_Structure(int func, int arity)
 {
   return Put_Structure_Tagged(Functor_Arity(func, arity));
@@ -583,7 +583,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Unify_Variable(void)
 {
   WamWord tag_mask, word;
@@ -614,7 +614,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Unify_Void(int n)
 {
   WamWord *cur_H;
@@ -643,7 +643,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Value(WamWord start_word)
 {
   if (S != WRITE_MODE)
@@ -661,7 +661,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Local_Value(WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -691,7 +691,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Atom_Tagged(WamWord w)
 {
   WamWord word, tag_mask;
@@ -722,7 +722,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Atom(int atom)
 {
   return Unify_Atom_Tagged(Tag_ATM(atom));
@@ -736,7 +736,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Integer_Tagged(WamWord w)
 {
   WamWord word, tag_mask;
@@ -771,7 +771,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Integer(long n)
 {
   return Unify_Integer_Tagged(Tag_INT(n));
@@ -785,7 +785,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Nil(void)
 {
   WamWord word, tag_mask;
@@ -815,7 +815,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_List(void)
 {
   WamWord *cur_H;
@@ -838,7 +838,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Structure_Tagged(WamWord w)
 {
   WamWord *cur_H;
@@ -862,7 +862,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-Bool
+Bool FC
 Unify_Structure(int func, int arity)
 {
   return Unify_Structure_Tagged(Functor_Arity(func, arity));
@@ -875,7 +875,7 @@
  * GLOBALIZE_IF_IN_LOCAL                                                   *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-WamWord
+WamWord FC
 Globalize_If_In_Local(WamWord start_word)
 {
   WamWord word, tag_mask;
@@ -900,7 +900,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Allocate(int n)
 {
   WamWord *old_E = E;
@@ -933,7 +933,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Deallocate(void)
 {
   WamWord *cur_E = E;
@@ -951,7 +951,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-CodePtr
+CodePtr FC
 Switch_On_Term(CodePtr c_var, CodePtr c_atm, CodePtr c_int,
               CodePtr c_lst, CodePtr c_stc)
 {
@@ -978,7 +978,7 @@
 
 
 
-CodePtr
+CodePtr FC
 Switch_On_Term_Var_Atm(CodePtr c_var, CodePtr c_atm)
 {
   WamWord word, tag_mask;
@@ -1002,7 +1002,7 @@
 
 
 
-CodePtr
+CodePtr FC
 Switch_On_Term_Var_Stc(CodePtr c_var, CodePtr c_stc)
 {
   WamWord word, tag_mask;
@@ -1026,7 +1026,7 @@
 
 
 
-CodePtr
+CodePtr FC
 Switch_On_Term_Var_Atm_Lst(CodePtr c_var, CodePtr c_atm, CodePtr c_lst)
 {
   WamWord word, tag_mask;
@@ -1053,7 +1053,7 @@
 
 
 
-CodePtr
+CodePtr FC
 Switch_On_Term_Var_Atm_Stc(CodePtr c_var, CodePtr c_atm, CodePtr c_stc)
 {
   WamWord word, tag_mask;
@@ -1089,7 +1089,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-CodePtr
+CodePtr FC
 Switch_On_Atom(SwtTbl t, int size)
 {
   SwtInf *swt;
@@ -1111,7 +1111,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-long
+long FC
 Switch_On_Integer(void)
 {
   return UnTag_INT(A(0));
@@ -1129,7 +1129,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-CodePtr
+CodePtr FC
 Switch_On_Structure(SwtTbl t, int size)
 {
   SwtInf *swt;
@@ -1142,12 +1142,55 @@
 
 
 
+#ifdef USE_WATERMARK
+
+/*-------------------------------------------------------------------------*/
+/* CREATE_WATER_MARK                                                       */
+/*                                                                         */
+/* Request warning if backtracking is not complete.                        */
+/*-------------------------------------------------------------------------*/
+
+int        wmark_count = 0;            /* number of active watermarks */
+Watermark  wmark[MAXWMARK];            /* The stack of watermarks */
+WatermarkP wmp = wmark-1;              /* Top of watermark stack */
+
+void Create_Water_Mark (void (*fun)(), void *par)
+{
+  if (++wmark_count >= MAXWMARK) {
+    Fatal_Error ("Watermark stack size (%d) exceeded! - aborting", MAXWMARK);
+  }
+  ++wmp;
+  wmp->Bvalue     = B;
+  wmp->destructor = fun;
+  wmp->parameter  = par;
+
+#ifdef DEBUG
+  fprintf(stderr,"Water Mark at: %d Position: %d %dB 
%dBB(B)\n",B,Wqty,WMark[Wqty],BB(B));
+#endif  
+}
+
+void Update_Water_Mark (void (*fun)(), void *par)
+{
+  if (wmark_count > 0) {
+    wmp->destructor = fun;
+    wmp->parameter  = par;
+  }
+  else {
+    fprintf(stderr, "Update_Water_Mark called with empty stack!\n");
+  }
+#ifdef DEBUG
+  fprintf(stderr,"Water Mark at: %d Position: %d %dB 
%dBB(B)\n",B,Wqty,WMark[Wqty],BB(B));
+#endif
+}
+#endif /* USE_WATERMARK */
+
+
 /*-------------------------------------------------------------------------*
  * LOAD_CUT_LEVEL                                                          *
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Load_Cut_Level(WamWord *word_adr)
 {
   *word_adr = From_B_To_WamWord(B);
@@ -1161,7 +1204,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Cut(WamWord b_word)
 {
   Assign_B(From_WamWord_To_B(b_word));
@@ -1178,7 +1221,7 @@
  * GLOBAL_PUSH_FLOAT                                                       *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Global_Push_Float(double n)
 {
   DblInt di;
@@ -1198,7 +1241,7 @@
  * OBTAIN_FLOAT                                                            *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-double
+double FC
 Obtain_Float(WamWord *adr)
 {
   DblInt di;
@@ -1270,7 +1313,7 @@
 
 
 
-void
+void FC
 Create_Choice_Point(CodePtr codep_alt, int arity)
 {
   int i;
@@ -1283,7 +1326,7 @@
 
 
 
-void
+void FC
 Create_Choice_Point1(CodePtr codep_alt)
 {
   CREATE_CHOICE_COMMON_PART(1);
@@ -1294,7 +1337,7 @@
 
 
 
-void
+void FC
 Create_Choice_Point2(CodePtr codep_alt)
 {
   CREATE_CHOICE_COMMON_PART(2);
@@ -1306,7 +1349,7 @@
 
 
 
-void
+void FC
 Create_Choice_Point3(CodePtr codep_alt)
 {
   CREATE_CHOICE_COMMON_PART(3);
@@ -1319,7 +1362,7 @@
 
 
 
-void
+void FC
 Create_Choice_Point4(CodePtr codep_alt)
 {
   CREATE_CHOICE_COMMON_PART(4);
@@ -1339,7 +1382,7 @@
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
 
-void
+void FC
 Update_Choice_Point(CodePtr codep_alt, int arity)
 {
   int i;
@@ -1352,7 +1395,7 @@
 
 
 
-void
+void FC
 Update_Choice_Point1(CodePtr codep_alt)
 {
   UPDATE_CHOICE_COMMON_PART;
@@ -1363,7 +1406,7 @@
 
 
 
-void
+void FC
 Update_Choice_Point2(CodePtr codep_alt)
 {
   UPDATE_CHOICE_COMMON_PART;
@@ -1375,7 +1418,7 @@
 
 
 
-void
+void FC
 Update_Choice_Point3(CodePtr codep_alt)
 {
   UPDATE_CHOICE_COMMON_PART;
@@ -1388,7 +1431,7 @@
 
 
 
-void
+void FC
 Update_Choice_Point4(CodePtr codep_alt)
 {
   UPDATE_CHOICE_COMMON_PART;
@@ -1407,7 +1450,7 @@
  *                                                                         *
  * Called by compiled prolog code.                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Delete_Choice_Point(int arity)
 {
   int i;
@@ -1420,7 +1463,7 @@
 
 
 
-void
+void FC
 Delete_Choice_Point1(void)
 {
   DELETE_CHOICE_COMMON_PART;
@@ -1431,7 +1474,7 @@
 
 
 
-void
+void FC
 Delete_Choice_Point2(void)
 {
   DELETE_CHOICE_COMMON_PART;
@@ -1443,7 +1486,7 @@
 
 
 
-void
+void FC
 Delete_Choice_Point3(void)
 {
   DELETE_CHOICE_COMMON_PART;
@@ -1456,7 +1499,7 @@
 
 
 
-void
+void FC
 Delete_Choice_Point4(void)
 {
   DELETE_CHOICE_COMMON_PART;
@@ -1474,7 +1517,7 @@
  * UNTRAIL                                                                 *
  *                                                                         *
  *-------------------------------------------------------------------------*/
-void
+void FC
 Untrail(WamWord *low_adr)
 {
   WamWord word;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]