Commit Graph

3 Commits

Author SHA1 Message Date
Julien Fischer
0cd62edc7c Clean-ups and fixes for the C interface examples.
samples/c_interface/*:
    Replace left over references to the old c_header_code pragma.

    Replace some uses of '__' as a module qualifier.

    Replace tabs with spaces.

    Add some missing words.
2023-02-25 12:53:26 +11:00
Fergus Henderson
2bda4471e2 Fix a bug where the Mercury calls C++ sample was not linking with the
Estimated hours taken: 0.25
Branches: main

Fix a bug where the Mercury calls C++ sample was not linking with the
C++ library.  This worked, because the sample didn't actually make use
of the C++ library, but failed as soon as users tried to extend the
sample to use with their real C++ programs.

samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
	Use the C++ standard library's stream I/O, rather than printf().

samples/c_interface/mercury_calls_cplusplus/Mmakefile:
	Make sure that we link with the C++ standard library.
	Also, comment out the old hack that worked around a g++ 2.7 bug
	which is fixed in g++ 2.95.
2003-10-09 03:09:53 +00:00
Fergus Henderson
c880e31dbe 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.
2003-10-08 12:15:44 +00:00