From 4889c6b7fd36713ae7b8a101ffb39dc2bddb2edc Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Fri, 30 Mar 2012 15:11:14 -0400 Subject: [PATCH 1/3] Don't use inline methods in dllexported classes to keep VC++ happy --- tests/libsample/CMakeLists.txt | 2 ++ tests/libsample/pen.cpp | 37 +++++++++++++++++++++++++++++++++++++ tests/libsample/pen.h | 18 +++++++++--------- tests/libsample/sbkdate.cpp | 29 +++++++++++++++++++++++++++++ tests/libsample/sbkdate.h | 8 ++++---- 5 files changed, 81 insertions(+), 13 deletions(-) create mode 100644 tests/libsample/pen.cpp create mode 100644 tests/libsample/sbkdate.cpp diff --git a/tests/libsample/CMakeLists.txt b/tests/libsample/CMakeLists.txt index 408920c..074de61 100644 --- a/tests/libsample/CMakeLists.txt +++ b/tests/libsample/CMakeLists.txt @@ -28,6 +28,7 @@ objectview.cpp overload.cpp overloadsort.cpp pairuser.cpp +pen.cpp photon.cpp point.cpp pointf.cpp @@ -36,6 +37,7 @@ protected.cpp reference.cpp sample.cpp samplenamespace.cpp +sbkdate.cpp simplefile.cpp size.cpp sometime.cpp diff --git a/tests/libsample/pen.cpp b/tests/libsample/pen.cpp new file mode 100644 index 0000000..592eaa3 --- /dev/null +++ b/tests/libsample/pen.cpp @@ -0,0 +1,37 @@ +/* + * This file is part of the Shiboken Python Binding Generator project. + * + * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). + * + * Contact: PySide team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "pen.h" + +Color::Color() : m_null(true) {} +Color::Color(SampleNamespace::InValue arg) : m_null(false) {} +Color::Color(unsigned int arg) : m_null(false) {} + +bool Color::isNull() const +{ return m_null; } + +Pen::Pen() : m_ctor(EmptyCtor) {} +Pen::Pen(SampleNamespace::Option option) : m_ctor(EnumCtor) {} +Pen::Pen(const Color& color) : m_ctor(ColorCtor) {} +Pen::Pen(const Pen& pen) : m_ctor(CopyCtor) {} + +int Pen::ctorType() { return m_ctor; } diff --git a/tests/libsample/pen.h b/tests/libsample/pen.h index a0c13ef..cdf4496 100644 --- a/tests/libsample/pen.h +++ b/tests/libsample/pen.h @@ -29,11 +29,11 @@ class LIBSAMPLE_API Color { public: - Color() : m_null(true) {} - Color(SampleNamespace::InValue arg) : m_null(false) {} - Color(unsigned int arg) : m_null(false) {} + Color(); + Color(SampleNamespace::InValue arg); + Color(unsigned int arg); - bool isNull() const { return m_null; } + bool isNull() const; private: bool m_null; }; @@ -43,12 +43,12 @@ class LIBSAMPLE_API Pen public: enum { EmptyCtor, EnumCtor, ColorCtor, CopyCtor }; - Pen() : m_ctor(EmptyCtor) {} - Pen(SampleNamespace::Option option) : m_ctor(EnumCtor) {} - Pen(const Color& color) : m_ctor(ColorCtor) {} - Pen(const Pen& pen) : m_ctor(CopyCtor) {} + Pen(); + Pen(SampleNamespace::Option option); + Pen(const Color& color); + Pen(const Pen& pen); - int ctorType() { return m_ctor; } + int ctorType(); private: int m_ctor; }; diff --git a/tests/libsample/sbkdate.cpp b/tests/libsample/sbkdate.cpp new file mode 100644 index 0000000..7f55184 --- /dev/null +++ b/tests/libsample/sbkdate.cpp @@ -0,0 +1,29 @@ +/* + * This file is part of the Shiboken Python Binding Generator project. + * + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * Contact: PySide team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "sbkdate.h" + +SbkDate::SbkDate(int d, int m, int y) : m_d(d), m_m(m), m_y(y) {} + +int SbkDate::day() const { return m_d; } +int SbkDate::month() const { return m_m; } +int SbkDate::year() const { return m_y; } diff --git a/tests/libsample/sbkdate.h b/tests/libsample/sbkdate.h index e41ed1f..a607374 100644 --- a/tests/libsample/sbkdate.h +++ b/tests/libsample/sbkdate.h @@ -28,11 +28,11 @@ class LIBSAMPLE_API SbkDate { public: - SbkDate(int d, int m, int y) : m_d(d), m_m(m), m_y(y) {} + SbkDate(int d, int m, int y); - inline int day() const { return m_d; } - inline int month() const { return m_m; } - inline int year() const { return m_y; } + inline int day() const; + inline int month() const; + inline int year() const; private: int m_d; -- 1.7.9.msysgit.0