Sorry for being late.<br><br><div class="gmail_quote">On Thu Jan 15 2015 at 6:23:03 PM Lawrence D'Oliveiro <<a href="mailto:ldo@geek-central.gen.nz">ldo@geek-central.gen.nz</a>> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
OK.<br>
<br>
---<br>
 <a href="http://configure.ac" target="_blank">configure.ac</a>           | 7 +++++++<br>
 src/dvdread/ifo_read.h | 6 ++++++<br>
 2 files changed, 13 insertions(+)<br></blockquote><div><br></div><div>The following nitpicking on ac macros is for next time only. The idea itself DLGTM.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff --git a/<a href="http://configure.ac" target="_blank">configure.ac</a> b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
index 9142673..697b234 100644<br>
--- a/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
@@ -47,6 +47,13 @@ AC_SUBST([DVDREAD_LTVERSION], [$DVDREAD_LT_CURRENT:$DVDREAD_<u></u>LT_REVISION:$DVDREAD<br>
<br>
 AC_PROG_CC<br>
<br>
+AS_ECHO_N(["checking whether C compiler supports __attribute__((deprecated))... "])<br></blockquote><div><br></div><div>AC_MSG_CHECKING</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+AC_COMPILE_IFELSE(<br>
+    [AC_LANG_PROGRAM([__attribute_<u></u>_((deprecated)) extern void f(void);], [])],<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+    [AS_ECHO([yes]); AC_DEFINE([HAVE_ATTRIBUTE_<u></u>DEPRECATED], [1], [define to 1 if C compiler allows __attribute__((deprecated))])]<u></u>,<br>
+    [AS_ECHO([no])]<br></blockquote><div><br></div><div>AC_MSG_RESULT</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+)<br>
+<br>
 AC_CHECK_HEADERS_ONCE([sys/<u></u>param.h limits.h dlfcn.h])<br>
<br>
 AC_SYS_LARGEFILE<br>
diff --git a/src/dvdread/ifo_read.h b/src/dvdread/ifo_read.h<br>
index 97f4179..8b58b61 100644<br>
--- a/src/dvdread/ifo_read.h<br>
+++ b/src/dvdread/ifo_read.h<br>
@@ -25,6 +25,12 @@<br>
 #include "ifo_types.h"<br>
 #include "dvdread/dvd_reader.h"<br>
<br>
+#if defined(HAVE_ATTRIBUTE_<u></u>DEPRECATED)<br>
+    #define __DEPRECATED__ __attribute__((deprecated))<br>
+#else<br>
+    #define __DEPRECATED__<br>
+#endif<br>
+<br>
 #ifdef __cplusplus<br>
 extern "C" {<br>
 #endif<br></blockquote><div><br></div><div>This simply won't work, which is the reason I did not suggest this in the first place in the other thread.</div><div><br></div><div><span style="font-size:13.3333330154419px">1. ifo_read.h does not include config.h, and thus will not ever get the definition of HAVE_ATTRIBUTE_</span><u style="font-size:13.3333330154419px"></u><span style="font-size:13.3333330154419px">DEPRECA</span><span style="font-size:13.3333330154419px">TED which is defined in config.h.</span><br></div><div>2. You can't include config.h in an installed header and it is unwise to install config.h with crazy things like HAVE_LIMITS_H.</div><div>3. You *CAN* use another config.h that is to be installed that includes <span style="font-size:13.3333330154419px">HAVE_ATTRIBUTE_</span><u style="font-size:13.3333330154419px"></u><span style="font-size:13.3333330154419px">DEPRECA</span><span style="font-size:13.3333330154419px">TED. But what if I am compiling my program with a version of GCC that is different from the one I used to compile the library, and that does not support deprecated attribute?</span></div><div><span style="font-size:13.3333330154419px"><br></span></div><div><span style="font-size:13.3333330154419px">Directly checking gcc version isn't pretty, I know, but it is not without </span>precedents<span style="font-size:13.3333330154419px">. For example, the PACKED macro is defined this way: </span><a href="https://github.com/mirror/libdvdread/blob/master/src/dvdread/ifo_types.h#L34-L37">https://github.com/mirror/libdvdread/blob/master/src/dvdread/ifo_types.h#L34-L37</a>. Plus FFmpeg/Libav have been doing this since 2006.</div><div><br></div><div>Hope this helps.</div><div><br></div><div>Timothy</div></div>