# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
# 
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
# 
# ROCK Linux: rock-src/package/base/ntp/gcc40.patch
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
# 
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# 
# --- ROCK-COPYRIGHT-NOTE-END ---

patch for ntp_config.c seems to be a workaround for a bug in GCC 4.0.2 o_O
 - stf

diff -dur ntp-4.2.0/include/ntpd.h src.ntp.1129999861.8262.1253845312/ntp-4.2.0/include/ntpd.h
--- ntp-4.2.0/include/ntpd.h	2003-09-13 05:08:04.000000000 +0200
+++ src.ntp.1129999861.8262.1253845312/ntp-4.2.0/include/ntpd.h	2005-10-24 00:29:57.000000000 +0200
@@ -227,7 +227,7 @@
 
 /* ntp_control.c */
 struct ctl_trap;
-extern struct ctl_trap ctl_trap[];
+extern struct ctl_trap *ctl_trap;
 extern int	num_ctl_traps;
 extern keyid_t	ctl_auth_keyid;		/* keyid used for authenticating write requests */
 
diff -dur ntp-4.2.0/include/ntp_stdlib.h src.ntp.1129999861.8262.1253845312/ntp-4.2.0/include/ntp_stdlib.h
--- ntp-4.2.0/include/ntp_stdlib.h	2003-07-17 12:27:16.000000000 +0200
+++ src.ntp.1129999861.8262.1253845312/ntp-4.2.0/include/ntp_stdlib.h	2005-10-24 00:29:23.000000000 +0200
@@ -135,7 +135,7 @@
 
 /* clocktypes.c */
 struct clktype;
-extern struct clktype clktypes[];
+extern struct clktype *clktypes;
 
 /* getopt.c */
 extern char *	ntp_optarg;		/* global argument pointer */
diff -dur ntp-4.2.0/libntp/clocktypes.c src.ntp.1129999861.8262.1253845312/ntp-4.2.0/libntp/clocktypes.c
--- ntp-4.2.0/libntp/clocktypes.c	2003-07-17 12:27:20.000000000 +0200
+++ src.ntp.1129999861.8262.1253845312/ntp-4.2.0/libntp/clocktypes.c	2005-10-24 00:31:43.000000000 +0200
@@ -9,7 +9,7 @@
 #include "ntp_refclock.h"
 #include "ntp_stdlib.h"
 
-struct clktype clktypes[] = {
+struct clktype _clktypes[] = {
 	{ REFCLK_NONE,		"unspecified type (0)",
 	  "UNKNOWN" },
 	{ REFCLK_LOCALCLOCK,	"Undisciplined local clock (1)",
@@ -102,6 +102,7 @@
 	  "NEOCLK4X"},
 	{ -1,			"", "" }
 };
+struct clktype *clktypes = _clktypes;
 
 const char *
 clockname(
diff -dur ntp-4.2.0/ntpd/ntp_config.c src.ntp.1129999861.8262.1253845312/ntp-4.2.0/ntpd/ntp_config.c
--- ntp-4.2.0/ntpd/ntp_config.c	2003-10-07 10:35:14.000000000 +0200
+++ src.ntp.1129999861.8262.1253845312/ntp-4.2.0/ntpd/ntp_config.c	2005-10-24 00:55:21.000000000 +0200
@@ -57,6 +57,8 @@
 	int keytype;
 };
 
+#define CONFIG_KEYS		8
+
 /*
  * Command keywords
  */
@@ -1118,7 +1120,7 @@
 			if (ntokens >= 2)
 			    sys_automax = 1 << max(atoi(tokens[1]), 10);
 			break;
-
+#define CONFIG_CRYPTO 39
 		    case CONFIG_CRYPTO:
 			if (ntokens == 1) {
 				crypto_config(CRYPTO_CONF_NONE, NULL);
diff -dur ntp-4.2.0/ntpd/ntp_control.c src.ntp.1129999861.8262.1253845312/ntp-4.2.0/ntpd/ntp_control.c
--- ntp-4.2.0/ntpd/ntp_control.c	2003-10-07 23:10:38.000000000 +0200
+++ src.ntp.1129999861.8262.1253845312/ntp-4.2.0/ntpd/ntp_control.c	2005-10-24 00:32:54.000000000 +0200
@@ -333,7 +333,7 @@
  * timed out.
  */
 /* ntp_request.c */
-struct ctl_trap ctl_trap[CTL_MAXTRAPS];
+struct ctl_trap *ctl_trap;
 int num_ctl_traps;
 
 /*
diff -dur ntp-4.2.0/ntpd/ntp_request.c src.ntp.1129999861.8262.1253845312/ntp-4.2.0/ntpd/ntp_request.c
--- ntp-4.2.0/ntpd/ntp_request.c	2003-10-07 13:02:33.000000000 +0200
+++ src.ntp.1129999861.8262.1253845312/ntp-4.2.0/ntpd/ntp_request.c	2005-10-24 00:47:53.000000000 +0200
@@ -2208,6 +2208,13 @@
 
 
 /*
+ * Imported from the control module
+ */
+extern struct ctl_trap *ctl_trap;
+extern int num_ctl_traps;
+
+
+/*
  * req_get_traps - return information about current trap holders
  */
 static void
@@ -2221,12 +2228,6 @@
 	register struct ctl_trap *tr;
 	register int i;
 
-	/*
-	 * Imported from the control module
-	 */
-	extern struct ctl_trap ctl_trap[];
-	extern int num_ctl_traps;
-
 	if (num_ctl_traps == 0) {
 		req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
 		return;