[glibmm/glibmm-2-20] Only compile the properties example if properties are enabled.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Subject: [glibmm/glibmm-2-20] Only compile the properties example if properties are enabled.
- Date: Fri, 17 Jul 2009 15:56:02 +0000 (UTC)
commit b43b39ce8d313963d657e4cac14d2d0109ad18a9
Author: David King <davidk openismus com>
Date: Fri Jul 17 17:36:04 2009 +0200
Only compile the properties example if properties are enabled.
examples/properties/properties_example.cc | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/examples/properties/properties_example.cc b/examples/properties/properties_example.cc
index b4c0327..c534790 100644
--- a/examples/properties/properties_example.cc
+++ b/examples/properties/properties_example.cc
@@ -18,6 +18,8 @@
#include <glibmm.h>
#include <iostream>
+// This example will not work without properties support
+#ifdef GLIBMM_PROPERTIES_ENABLED
// A class that contains properties must inherit from Glib::Object (or a class
// that inherits from Glib::Object)
class Person : public Glib::Object
@@ -56,9 +58,11 @@ void on_lastname_changed ()
{ std::cout << "- lastname changed!" << std::endl; }
void on_age_changed ()
{ std::cout << "- age changed!" << std::endl; }
+#endif // GLIBMM_PROPERTIES_ENABLED
int main (int argc, char** argv)
{
+#ifdef GLIBMM_PROPERTIES_ENABLED
Glib::init ();
Person p;
// Register some handlers that will be called when the values of the
@@ -78,4 +82,5 @@ int main (int argc, char** argv)
std::cout << "Done changing the properties of 'p'" << std::endl;
return 0;
+#endif // GLIBMM_PROPERTIES_ENABLED
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]