Bejamin Kuit. #define MYSQL and MYSQL_ROW to void iff <mysql.h> not found.
[samba.git] / source3 / include / includes.h
index fc718961a954c9f595d9334b658d04694538c2dc..0d2561f6bcb0128e0caa422805cc67dda258592e 100644 (file)
@@ -29,6 +29,7 @@
 
 #ifdef AIX
 #define DEFAULT_PRINTING PRINT_AIX
+#define PRINTCAP_NAME "/etc/qconfig"
 #endif
 
 #ifdef HPUX
 #endif
 
 
+/* if we have both SYSV IPC and shared mmap then we need to choose. For most
+   systems it is much faster to use SYSV IPC, but under Linux it is
+   about 5 times faster to use fcntl, so for Linux systems we force
+   fcntl based locking */
+#if (defined(HAVE_SYSV_IPC) && defined(HAVE_SHARED_MMAP))
+# ifdef LINUX
+#  undef HAVE_SYSV_IPC
+# else
+#  undef HAVE_SHARED_MMAP
+# endif
+#endif
+
+
 #include <sys/types.h>
 
 #ifdef TIME_WITH_SYS_TIME
 #include <stdio.h>
 #include <stddef.h>
 
+#include <netinet/in.h>
+#if defined(HAVE_RPC_RPC_H)
+#include <rpc/rpc.h>
+#endif
+
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
 #include <varargs.h>
 #endif
 
-#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <syslog.h>
 # endif
 #endif
 
-#ifdef HAVE_SHARED_MMAP
+#ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
 
 #include <sys/sem.h>
 #endif
 
+#if 0
+/*
+ *  I have removed this as it prevents compilation under SCO Server
+ *  3.2. If you need to add it back in then please add a comment as to
+ *  why it's needed and what OS it's needed for so we can work out how
+ *  to test for it properly (tridge) */
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#endif
+
 #ifdef HAVE_NET_IF_H
 #include <net/if.h>
 #endif
 #include <sys/capability.h>
 #endif
 
+#if defined(HAVE_RPC_RPC_H)
+#include <rpc/rpc.h>
+#endif
+
+#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined(HAVE_SETNETGRENT) && defined(HAVE_ENDNETGRENT) && defined(HAVE_GETNETGRENT)
+#define HAVE_NETGROUP 1
+#endif
+
+#if defined (HAVE_NETGROUP)
+#if defined(HAVE_RPCSVC_YP_PROT_H)
+#include <rpcsvc/yp_prot.h>
+#endif
+#if defined(HAVE_RPCSVC_YPCLNT_H)
+#include <rpcsvc/ypclnt.h>
+#endif
+#endif /* HAVE_NETGROUP */
+
+#if defined(HAVE_MYSQL_H)
+#include <mysql.h>
+#else
+/* needed to get make proto to work with no <mysql.h> */
+#define MYSQL     void
+#define MYSQL_ROW void
+#endif
+
 #ifndef uchar
 #define uchar unsigned char
 #endif
 #define uint8 unsigned char
 #endif
 
-#ifndef int16
+#if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
 #if (SIZEOF_SHORT == 4)
 #define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
 #else /* SIZEOF_SHORT != 4 */
 #endif /* SIZEOF_SHORT != 4 */
 #endif
 
-#ifndef uint16
-#define uint16 unsigned int16
+/*
+ * Note we duplicate the size tests in the unsigned 
+ * case as int16 may be a typedef from rpc/rpc.h
+ */
+
+#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
+#if (SIZEOF_SHORT == 4)
+#define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
+#else /* SIZEOF_SHORT != 4 */
+#define uint16 unsigned short
+#endif /* SIZEOF_SHORT != 4 */
 #endif
 
-#ifndef int32
+#if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
 #if (SIZEOF_INT == 4)
 #define int32 int
 #elif (SIZEOF_LONG == 4)
 #endif
 #endif
 
-#ifndef uint32
-#define uint32 unsigned int32
+/*
+ * Note we duplicate the size tests in the unsigned 
+ * case as int32 may be a typedef from rpc/rpc.h
+ */
+
+#if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)
+#if (SIZEOF_INT == 4)
+#define uint32 unsigned int
+#elif (SIZEOF_LONG == 4)
+#define uint32 unsigned long
+#elif (SIZEOF_SHORT == 4)
+#define uint32 unsigned short
+#endif
 #endif
 
 /*
@@ -486,8 +560,6 @@ extern int errno;
 #include "ubi_Cache.h"
 #endif /* UBI_BINTREE_H */
 
-#include "debugparse.h"
-
 #include "version.h"
 #include "smb.h"
 #include "smbw.h"
@@ -543,9 +615,15 @@ extern int errno;
 #ifndef DEFAULT_PRINTING
 #ifdef SYSV
 #define DEFAULT_PRINTING PRINT_SYSV
+#define PRINTCAP_NAME "lpstat"
 #else
 #define DEFAULT_PRINTING PRINT_BSD
+#define PRINTCAP_NAME "/etc/printcap"
+#endif
 #endif
+
+#ifndef PRINTCAP_NAME
+#define PRINTCAP_NAME "/etc/printcap"
 #endif
 
 #ifndef SIGCLD
@@ -572,6 +650,7 @@ union semun {
 
 #if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP))
 #define USE_SMBPASS_DB 1
+#define USE_SMBUNIX_DB 1
 #endif
 
 #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
@@ -582,22 +661,6 @@ union semun {
 #define HAVE_PAM 1
 #endif
 
-#if defined(HAVE_YP_GET_DEFAULT_DOMAIN)
-#define HAVE_NETGROUP 1
-#endif
-
-#if defined (HAVE_NETGROUP)
-#if defined(HAVE_RPC_RPC_H)
-#include <rpc/rpc.h>
-#endif
-#if defined(HAVE_RPCSVC_YP_PROT_H)
-#include <rpcsvc/yp_prot.h>
-#endif
-#if defined(HAVE_RPCSVC_YPCLNT_H)
-#include <rpcsvc/ypclnt.h>
-#endif
-#endif /* HAVE_NETGROUP */
-
 #ifndef ALLOW_CHANGE_PASSWORD
 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
 #define ALLOW_CHANGE_PASSWORD 1