From 0c1bcaeb9402a4ebf2586091a31fc6a04b86686e Mon Sep 17 00:00:00 2001 From: George Danchev Date: Tue, 5 Jul 2011 18:52:20 +0000 Subject: [PATCH] use extern C so that the compiler considers C bindings --- libisoburn/trunk/releng/codesamples/sample1.cpp | 15 ++++++++++----- libisoburn/trunk/releng/codesamples/sample2.cpp | 12 +++--------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/libisoburn/trunk/releng/codesamples/sample1.cpp b/libisoburn/trunk/releng/codesamples/sample1.cpp index c3d4055f..e032bd4d 100644 --- a/libisoburn/trunk/releng/codesamples/sample1.cpp +++ b/libisoburn/trunk/releng/codesamples/sample1.cpp @@ -7,15 +7,20 @@ #include #include + +extern "C" { #include "xorriso/xorriso.h" +} int main() { + int major=-1, minor=-1, micro=-1; + Xorriso__version(&major, &minor, µ); + if (major<0 || minor<0 || micro<0) + return -1; std::cout - << " major:" << Xorriso_header_version_majoR - << " minor:" << Xorriso_header_version_minoR - << " micro:" << Xorriso_header_version_micrO + << " major:" << major + << " minor:" << minor + << " micro:" << micro ; -// << std::endl; - return 0; } diff --git a/libisoburn/trunk/releng/codesamples/sample2.cpp b/libisoburn/trunk/releng/codesamples/sample2.cpp index 94f1cc74..558cd643 100644 --- a/libisoburn/trunk/releng/codesamples/sample2.cpp +++ b/libisoburn/trunk/releng/codesamples/sample2.cpp @@ -7,14 +7,16 @@ #include #include + +extern "C" { #include #include // using namespace burn; // (this was needed to before rev.4062 of libisoburn) #include +} int main() { -/* int major=-1, minor=-1, micro=-1; isoburn_version(&major, &minor, µ); if (major<0 || minor<0 || micro<0) @@ -24,13 +26,5 @@ int main() { << " minor:" << minor << " micro:" << micro ; -*/ - std::cout - << " major:" << isoburn_libisofs_req_major // major - << " minor:" << isoburn_libisofs_req_minor // minor - << " micro:" << isoburn_libisofs_req_micro // micro - ; - // << std::endl; - return 0; }