Author: leo
Date: Sat Mar 11 08:53:43 2006
New Revision: 11864

Modified:
   trunk/languages/pugs/include/pugs_common.h
   trunk/languages/pugs/pmc/pugsbit.pmc
   trunk/languages/pugs/t/pmc/bit.t

Log:
fix lib loading

Modified: trunk/languages/pugs/include/pugs_common.h
==============================================================================
--- trunk/languages/pugs/include/pugs_common.h  (original)
+++ trunk/languages/pugs/include/pugs_common.h  Sat Mar 11 08:53:43 2006
@@ -1,4 +1,9 @@
+#if !defined(PARROT_PUGS_COMMONL_H_GUARD)
+#define PARROT_PUGS_COMMONL_H_GUARD
 
+#ifndef PUGS_BIT
 extern PMC *pugs_bit_true;
 extern PMC *pugs_bit_false;
+#endif
 
+#endif

Modified: trunk/languages/pugs/pmc/pugsbit.pmc
==============================================================================
--- trunk/languages/pugs/pmc/pugsbit.pmc        (original)
+++ trunk/languages/pugs/pmc/pugsbit.pmc        Sat Mar 11 08:53:43 2006
@@ -18,11 +18,14 @@
 
 */
 
+#define PUGS_BIT
+
 #include "parrot/parrot.h"
 #include "pmc_pugsbit.h"
+#include "../include/pugs_common.h"
 
-static PMC *pugs_bit_true;
-static PMC *pugs_bit_false;
+PMC *pugs_bit_true;
+PMC *pugs_bit_false;
 
 pmclass PugsBit
     extends Boolean
@@ -35,7 +38,6 @@
     maps Boolean
 {
     void class_init() {
-        Parrot_PugsBase_super_init(INTERP, NULL);
         /* generate a PugsBitTrue and a PugsBitFalse here */
         pugs_bit_true  = pmc_new(interp, entry);
         pugs_bit_false = pmc_new(interp, entry);

Modified: trunk/languages/pugs/t/pmc/bit.t
==============================================================================
--- trunk/languages/pugs/t/pmc/bit.t    (original)
+++ trunk/languages/pugs/t/pmc/bit.t    Sat Mar 11 08:53:43 2006
@@ -16,12 +16,23 @@
 use Test::More;

 

 pir_output_is(<< 'CODE', << 'OUTPUT', "check sanity");

+.sub _main

+    loadlib $P1, "pugs_group"

+    $I0 = defined $P1 

+    if $I0 goto ok

+    print "not "

+ok:

+    print "ok\n"

+.end

+CODE

+ok

+OUTPUT

+

+pir_output_is(<< 'CODE', << 'OUTPUT', "check sanity");

 .HLL "Perl6", "pugs_group"

 .sub _main

-    loadlib P1, "pugs_group"

-    find_type $I0, "PugsBit"

     .local pmc pmc1

-    pmc1 = new $I0

+    pmc1 = new .PugsBit

     print "ok\n"

 .end

 CODE

Reply via email to