]> Pileus Git - ~andy/gtk/commitdiff
docs: Add examples for use of GDK_VERSION_MIN_REQUIRED
authorMatthias Clasen <mclasen@redhat.com>
Thu, 2 Aug 2012 23:49:56 +0000 (01:49 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 4 Aug 2012 20:14:31 +0000 (16:14 -0400)
I had to work this out for myself, so better document it.

docs/reference/gtk/compiling.sgml

index 03206d92067197cbd8a57ad5cf6bfe4578f685ab..827e408a4e7d1ec54c656bd2b33313ac4ada5db7 100644 (file)
@@ -63,6 +63,22 @@ to use. APIs that were deprecated before or introduced after
 this range will trigger compiler warnings.
 </para>
 
+<para>
+Here is how you would compile hello.c if you want to allow it
+to use symbols that were not deprecated in 3.2:
+<programlisting>
+$ cc -DGDK_VERSION_MIN_REQIRED=GDK_VERSION_3_2 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
+</programlisting>
+</para>
+
+<para>
+And here is how you would compile hello.c if you don't want
+it to use any symbols that were introduced after 3.4:
+<programlisting>
+$ cc -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4 `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
+</programlisting>
+</para>
+
 <para>
 The older deprecation mechanism of hiding deprecated interfaces
 entirely from the compiler by using the preprocessor symbol