mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-12 04:14:06 +00:00
Fix a bug where the Mercury calls C++ sample was actually using C, not C++.
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.
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cpp_main.h"
|
||||
|
||||
void cpp_main(void) {
|
||||
printf("In cpp_main().\n");
|
||||
}
|
||||
12
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc
Normal file
12
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc
Normal file
@@ -0,0 +1,12 @@
|
||||
// This source file is hereby placed in the public domain. -fjh (the author).
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cpp_main.h"
|
||||
|
||||
// Use some C++ features
|
||||
class Foo { };
|
||||
|
||||
void cpp_main(void) {
|
||||
printf("In cpp_main().\n");
|
||||
}
|
||||
Reference in New Issue
Block a user