[m-rev.] diff: use C++ not C for mercury_calls_cplusplus sample

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 8 22:14:44 AEST 2003


Estimated hours taken: 0.25
Branches: main

Fix a bug where the Mercury calls C++ sample was actually using C, not C++.

samples/c_interface/mercury_calls_cplusplus/cpp_main.c:
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
	Rename cpp_main.c as cpp_main.cc, so that it gets compiled as C++
	code rather than as C code.  Add a dummy class declaration to its
	source, to check that it is really C++ code.

Workspace: /home/ceres/fjh/mercury
Index: samples/c_interface/mercury_calls_cplusplus/cpp_main.c
===================================================================
RCS file: samples/c_interface/mercury_calls_cplusplus/cpp_main.c
diff -N samples/c_interface/mercury_calls_cplusplus/cpp_main.c
--- samples/c_interface/mercury_calls_cplusplus/cpp_main.c	31 Jan 1997 19:04:44 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-#include "cpp_main.h"
-
-void cpp_main(void) {
-	printf("In cpp_main().\n");
-}
Index: samples/c_interface/mercury_calls_cplusplus/cpp_main.cc
===================================================================
RCS file: samples/c_interface/mercury_calls_cplusplus/cpp_main.cc
diff -N samples/c_interface/mercury_calls_cplusplus/cpp_main.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ samples/c_interface/mercury_calls_cplusplus/cpp_main.cc	8 Oct 2003 12:07:31 -0000
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+#include "cpp_main.h"
+
+// Use some C++ features
+class Foo { };
+
+void cpp_main(void) {
+	printf("In cpp_main().\n");
+}

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list