From 8d15cbf39b8aa01eaabfa3167e6ce3dc9f9e0af8 Mon Sep 17 00:00:00 2001 From: Andrew Shadura Date: Sat, 25 Jul 2015 14:44:48 +0200 Subject: Imported Upstream version 0.27.0 --- examples/hello_cxx/Makefile | 2 +- examples/hello_cxx/expect.out | 24 ++++++++++++++++++++++++ examples/hello_cxx/five.c | 6 ++++++ examples/hello_cxx/five.h | 14 ++++++++++++++ examples/hello_cxx/main.cc | 6 ++++++ examples/hello_cxx/seven.c | 6 ++++++ examples/hello_cxx/seven.h | 14 ++++++++++++++ 7 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 examples/hello_cxx/five.c create mode 100644 examples/hello_cxx/five.h create mode 100644 examples/hello_cxx/seven.c create mode 100644 examples/hello_cxx/seven.h (limited to 'examples/hello_cxx') diff --git a/examples/hello_cxx/Makefile b/examples/hello_cxx/Makefile index f9a1a11..be0460d 100644 --- a/examples/hello_cxx/Makefile +++ b/examples/hello_cxx/Makefile @@ -4,7 +4,7 @@ WARNS = 4 CPPFLAGS += -I. -SRCS = hello_msg.cc main.cc +SRCS = main.cc hello_msg.cc five.c seven.c MKC_REQD = 0.12.9 diff --git a/examples/hello_cxx/expect.out b/examples/hello_cxx/expect.out index 626ff9f..2d97290 100644 --- a/examples/hello_cxx/expect.out +++ b/examples/hello_cxx/expect.out @@ -1,11 +1,20 @@ Hello world! +Five: 5 +Seven: 7 =========== all ============ /objdir/Makefile +/objdir/_mkc_compiler_type.err +/objdir/_mkc_compiler_type.res /objdir/_mkc_cxx_type.err /objdir/_mkc_cxx_type.res +/objdir/_mkc_prog_cc.err +/objdir/_mkc_prog_cc.res /objdir/_mkc_prog_cxx.err /objdir/_mkc_prog_cxx.res /objdir/expect.out +/objdir/five.c +/objdir/five.h +/objdir/five.o /objdir/hello_cxx /objdir/hello_cxx.test.out.tmp /objdir/hello_msg.cc @@ -13,6 +22,9 @@ Hello world! /objdir/hello_msg.o /objdir/main.cc /objdir/main.o +/objdir/seven.c +/objdir/seven.h +/objdir/seven.o /objdir/test.mk ========= install ========== /objdir/prefix @@ -21,21 +33,33 @@ Hello world! ======== uninstall ========= ========== clean =========== /objdir/Makefile +/objdir/_mkc_compiler_type.err +/objdir/_mkc_compiler_type.res /objdir/_mkc_cxx_type.err /objdir/_mkc_cxx_type.res +/objdir/_mkc_prog_cc.err +/objdir/_mkc_prog_cc.res /objdir/_mkc_prog_cxx.err /objdir/_mkc_prog_cxx.res /objdir/expect.out +/objdir/five.c +/objdir/five.h /objdir/hello_cxx.test.out.tmp /objdir/hello_msg.cc /objdir/hello_msg.h /objdir/main.cc +/objdir/seven.c +/objdir/seven.h /objdir/test.mk ======= distclean ========== /objdir/Makefile /objdir/expect.out +/objdir/five.c +/objdir/five.h /objdir/hello_cxx.test.out.tmp /objdir/hello_msg.cc /objdir/hello_msg.h /objdir/main.cc +/objdir/seven.c +/objdir/seven.h /objdir/test.mk diff --git a/examples/hello_cxx/five.c b/examples/hello_cxx/five.c new file mode 100644 index 0000000..1b2f63f --- /dev/null +++ b/examples/hello_cxx/five.c @@ -0,0 +1,6 @@ +#include "five.h" + +int five (void) +{ + return 5; +} diff --git a/examples/hello_cxx/five.h b/examples/hello_cxx/five.h new file mode 100644 index 0000000..51f786b --- /dev/null +++ b/examples/hello_cxx/five.h @@ -0,0 +1,14 @@ +#ifndef _FIVE_H_ +#define _FIVE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +int five (void); + +#ifdef __cplusplus +}; +#endif + +#endif // _FIVE_H_ diff --git a/examples/hello_cxx/main.cc b/examples/hello_cxx/main.cc index 4b93a98..1d99736 100644 --- a/examples/hello_cxx/main.cc +++ b/examples/hello_cxx/main.cc @@ -1,7 +1,13 @@ #include "hello_msg.h" +#include "five.h" +#include "seven.h" + +#include int main (int argc, char **argv) { hello_msg (); + std::cout << "Five: " << five () << '\n'; + std::cout << "Seven: " << seven () << '\n'; return 0; } diff --git a/examples/hello_cxx/seven.c b/examples/hello_cxx/seven.c new file mode 100644 index 0000000..1e4316a --- /dev/null +++ b/examples/hello_cxx/seven.c @@ -0,0 +1,6 @@ +#include "seven.h" + +int seven (void) +{ + return 7; +} diff --git a/examples/hello_cxx/seven.h b/examples/hello_cxx/seven.h new file mode 100644 index 0000000..34c3642 --- /dev/null +++ b/examples/hello_cxx/seven.h @@ -0,0 +1,14 @@ +#ifndef _SEVEN_H_ +#define _SEVEN_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +int seven (void); + +#ifdef __cplusplus +}; +#endif + +#endif // _SEVEN_H_ -- cgit v1.2.3