Change the way module initialisation is done (#3252, #4417)
[ghc-hetmet.git] / docs / users_guide / win32-dlls.xml
index eaa3d38..f00e1e2 100644 (file)
@@ -427,9 +427,7 @@ foreign export stdcall adder :: Int -> Int -> IO Int
 </para>
 <programlisting>
 // StartEnd.c
-#include <Rts.h>
-
-extern void __stginit_Adder(void);
+#include &lt;Rts.h&gt;
 
 void HsStart()
 {
@@ -438,10 +436,7 @@ void HsStart()
 
    // Initialize Haskell runtime
    char** args = argv;
-   hs_init(&argc, &args);
-
-   // Tell Haskell about all root modules
-   hs_add_root(__stginit_Adder);
+   hs_init(&amp;argc, &amp;args);
 }
 
 void HsEnd()
@@ -499,7 +494,7 @@ HsStart
 End Sub
 
 Public Sub Test()
-MsgBox "12 + 5 = " & Adder(12, 5)
+MsgBox "12 + 5 = " &amp; Adder(12, 5)
 End Sub
 </programlisting>
 <para>
@@ -522,7 +517,7 @@ End Sub
 // Tester.cpp
 #include "HsFFI.h"
 #include "Adder_stub.h"
-#include <stdio.h>
+#include &lt;stdio.h&gt;
 
 extern "C" {
     void HsStart();
@@ -547,6 +542,8 @@ $ tester
 12 + 5 = 17
 </screen>
 
+</sect3>
+
 </sect2>
 
 </sect1>