r14111: Work around additional typedefs in the gamin implementation
authorJames Peach <jpeach@samba.org>
Thu, 9 Mar 2006 22:31:05 +0000 (22:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:11:12 +0000 (11:11 -0500)
of the FAM API.
(This used to be commit dc96ce90e50da9a82f941b0b534c0681c8477f5e)

source3/configure.in
source3/smbd/notify_fam.c

index 08e52ef145b2853e66f1e5fb30c839f6b0c0c22d..16efdf9289736b5e60f2905e632bbd5730f140d6 100644 (file)
@@ -2272,6 +2272,11 @@ fi
 if test x"$samba_cv_HAVE_LIBFAM" = x"yes" ; then
     AC_DEFINE(HAVE_FAM_CHANGE_NOTIFY, 1,
            [Whether FAM is file notifications are available])
+    AC_TRY_COMPILE([#include <fam.h>],
+               [FAMCodes code = FAMChanged;],
+               AC_DEFINE(HAVE_FAM_H_FAMCODES_TYPEDEF, 1,
+                   [Whether fam.h contains a typedef for enum FAMCodes]),
+               [])
 fi
 
 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
index dd1e5b709e1f5e305b6ef77468b43853d1f9905f..3b6be77acab34f47e4021035c267635fd8b78e46 100644 (file)
 
 #include <fam.h>
 
+#if !defined(HAVE_FAM_H_FAMCODES_TYPEDEF)
+/* Gamin provides this typedef which means we can't use 'enum FAMCodes' as per
+ * every other FAM implementation. Phooey.
+ */
+typedef enum FAMCodes FAMCodes;
+#endif
+
 /* NOTE: There are multiple versions of FAM floating around the net, each with
  * slight differences from the original SGI FAM implementation. In this file,
  * we rely only on the SGI features and do not assume any extensions. For
@@ -40,7 +47,7 @@ struct fam_req_info
 {
     FAMRequest     req;
     int                    generation;
-    enum FAMCodes   code;
+    FAMCodes       code;
     enum
     {
        /* We are waiting for an event. */
@@ -91,9 +98,9 @@ static struct cnotify_fns global_fam_notify =
  * because that might not work across all flavours of FAM.
  */
 static const char *
-fam_event_str(enum FAMCodes code)
+fam_event_str(FAMCodes code)
 {
-    static struct { enum FAMCodes code; const char * name; } evstr[] =
+    static const struct { FAMCodes code; const char * name; } evstr[] =
     {
        { FAMChanged,           "FAMChanged"},
        { FAMDeleted,           "FAMDeleted"},
@@ -188,7 +195,7 @@ fam_monitor_path(connection_struct *        conn,
 }
 
 static BOOL
-fam_handle_event(enum FAMCodes code, uint32 flags)
+fam_handle_event(const FAMCodes code, uint32 flags)
 {
 #define F_CHANGE_MASK (FILE_NOTIFY_CHANGE_FILE | \
                        FILE_NOTIFY_CHANGE_ATTRIBUTES | \