Author: paulg
Date: 2006-04-26 14:56:27 +0000 (Wed, 26 Apr 2006)
New Revision: 15282

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15282

Log:
This mod adds prototypes for previously unprototyped static initialization 
functions.  Some compilers (cough, cough), return structures (even structures 
that fit in 32 bits) differently than ints.  Without these prototypes, the 
compiled code doesn't work.  Anyway, it is good practice to prototype 
everything.  Once I see this mod build in head, I will also add it to the 
SAMBA_3_0 branch. I've been using these changes for quite some time on VOS.  -- 
paulg
Modified:
   trunk/source/aclocal.m4
   trunk/source/auth/auth.c
   trunk/source/auth/auth_script.c
   trunk/source/lib/iconv.c
   trunk/source/passdb/pdb_interface.c
   trunk/source/sam/idmap.c
   trunk/source/smbd/server.c
   trunk/source/smbd/vfs.c


Changeset:
Modified: trunk/source/aclocal.m4
===================================================================
--- trunk/source/aclocal.m4     2006-04-26 14:42:47 UTC (rev 15281)
+++ trunk/source/aclocal.m4     2006-04-26 14:56:27 UTC (rev 15282)
@@ -57,6 +57,7 @@
                string_shared_modules="$string_shared_modules $1"
        elif test x"$DEST" = xSTATIC; then
                [init_static_modules_]translit([$4], [A-Z], 
[a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z])  $1_init();"
+               [decl_static_modules_]translit([$4], [A-Z], 
[a-z])="$[decl_static_modules_]translit([$4], [A-Z], [a-z]) extern NTSTATUS 
$1_init();"
                string_static_modules="$string_static_modules $1"
                $4_STATIC="$$4_STATIC $2"
                AC_SUBST($4_STATIC)
@@ -73,6 +74,7 @@
        AC_SUBST($1_STATIC)
        AC_SUBST($1_MODULES)
        AC_DEFINE_UNQUOTED([static_init_]translit([$1], [A-Z], [a-z]), 
[{$init_static_modules_]translit([$1], [A-Z], [a-z])[}], [Static init 
functions])
+       AC_DEFINE_UNQUOTED([static_decl_]translit([$1], [A-Z], [a-z]), 
[$decl_static_modules_]translit([$1], [A-Z], [a-z]), [Decl of Static init 
functions])
        ifelse([$2], , :, [rm -f $2])
 ])
 

Modified: trunk/source/auth/auth.c
===================================================================
--- trunk/source/auth/auth.c    2006-04-26 14:42:47 UTC (rev 15281)
+++ trunk/source/auth/auth.c    2006-04-26 14:56:27 UTC (rev 15282)
@@ -23,6 +23,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
+static_decl_auth;
+
 static struct auth_init_function_entry *backends = NULL;
 
 static struct auth_init_function_entry *auth_find_backend_entry(const char 
*name);

Modified: trunk/source/auth/auth_script.c
===================================================================
--- trunk/source/auth/auth_script.c     2006-04-26 14:42:47 UTC (rev 15281)
+++ trunk/source/auth/auth_script.c     2006-04-26 14:56:27 UTC (rev 15282)
@@ -140,16 +140,14 @@
        return NT_STATUS_OK;
 }
 
-#if 0
 /* Define this to build static. */
 NTSTATUS auth_script_init(void)
 {
        return smb_register_auth(AUTH_INTERFACE_VERSION, "script", 
auth_init_script);
 }
-#else
+
 /* Define this to build shared. */
 NTSTATUS init_module(void)
 {
        return smb_register_auth(AUTH_INTERFACE_VERSION, "script", 
auth_init_script);
 }
-#endif

Modified: trunk/source/lib/iconv.c
===================================================================
--- trunk/source/lib/iconv.c    2006-04-26 14:42:47 UTC (rev 15281)
+++ trunk/source/lib/iconv.c    2006-04-26 14:56:27 UTC (rev 15282)
@@ -51,6 +51,8 @@
  * @sa Samba Developers Guide
  **/
 
+static_decl_charset;
+
 static size_t ascii_pull(void *,const char **, size_t *, char **, size_t *);
 static size_t ascii_push(void *,const char **, size_t *, char **, size_t *);
 static size_t latin1_push(void *,const char **, size_t *, char **, size_t *);

Modified: trunk/source/passdb/pdb_interface.c
===================================================================
--- trunk/source/passdb/pdb_interface.c 2006-04-26 14:42:47 UTC (rev 15281)
+++ trunk/source/passdb/pdb_interface.c 2006-04-26 14:56:27 UTC (rev 15282)
@@ -30,6 +30,8 @@
 
 static struct samu *csamuser = NULL;
 
+static_decl_pdb;
+
 static struct pdb_init_function_entry *backends = NULL;
 
 static void lazy_initialize_passdb(void)

Modified: trunk/source/sam/idmap.c
===================================================================
--- trunk/source/sam/idmap.c    2006-04-26 14:42:47 UTC (rev 15281)
+++ trunk/source/sam/idmap.c    2006-04-26 14:56:27 UTC (rev 15282)
@@ -25,6 +25,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
 
+static_decl_idmap;
+
 struct idmap_function_entry {
        const char *name;
        struct idmap_methods *methods;

Modified: trunk/source/smbd/server.c
===================================================================
--- trunk/source/smbd/server.c  2006-04-26 14:42:47 UTC (rev 15281)
+++ trunk/source/smbd/server.c  2006-04-26 14:56:27 UTC (rev 15282)
@@ -22,6 +22,8 @@
 
 #include "includes.h"
 
+static_decl_rpc;
+
 static int am_parent = 1;
 
 /* the last message the was processed */

Modified: trunk/source/smbd/vfs.c
===================================================================
--- trunk/source/smbd/vfs.c     2006-04-26 14:42:47 UTC (rev 15281)
+++ trunk/source/smbd/vfs.c     2006-04-26 14:56:27 UTC (rev 15282)
@@ -27,6 +27,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
 
+static_decl_vfs;
+
 struct vfs_init_function_entry {
        char *name;
        vfs_op_tuple *vfs_op_tuples;

Reply via email to