import from HEAD
authorfcusack <fcusack>
Tue, 24 Oct 2006 05:15:45 +0000 (05:15 +0000)
committerfcusack <fcusack>
Tue, 24 Oct 2006 05:15:45 +0000 (05:15 +0000)
prevent rcsid from being optimized out

src/modules/rlm_otp/extern.h
src/modules/rlm_otp/ident.h [new file with mode: 0644]
src/modules/rlm_otp/otp.h
src/modules/rlm_otp/otp_mppe.c
src/modules/rlm_otp/otp_mppe.h
src/modules/rlm_otp/otp_pw_valid.c
src/modules/rlm_otp/otp_pw_valid.h
src/modules/rlm_otp/otp_pwe.c
src/modules/rlm_otp/otp_radstate.c
src/modules/rlm_otp/otp_rlm.c
src/modules/rlm_otp/otp_util.c

index 3dc2c1a..4dcd5f6 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef EXTERN_H
 #define EXTERN_H
 
+#include "ident.h"
+RCSIDH(extern_h, "$Id$")
+
 #include <autoconf.h>
 #include <radiusd.h>
 #include <modules.h>
diff --git a/src/modules/rlm_otp/ident.h b/src/modules/rlm_otp/ident.h
new file mode 100644 (file)
index 0000000..2765e60
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * $Id$
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it 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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ * Copyright 2006 TRI-D Systems, Inc.
+ */
+
+#ifndef IDENT_H
+#define IDENT_H
+
+#if defined(__GNUC__)
+/* force inclusion of ident keywords in the face of optimization */
+#define RCSID(id) static const char rcsid[] __attribute__ ((used)) = id;
+#define RCSIDH(h, id) static const char rcsid_ ## h [] __attribute__ ((used)) = id;
+#elif defined(__SUNPRO_C)
+/* put ident keyword into comment section (nicer than gcc way) */
+#define DO_PRAGMA(x) _Pragma(#x)
+#define RCSID(id) DO_PRAGMA(sun ident id)
+#define RCSIDH(h, id) DO_PRAGMA(sun ident id)
+#endif
+
+#endif /* IDENT_H */
index bf708b6..defe016 100644 (file)
@@ -21,9 +21,8 @@
 #ifndef OTP_H
 #define OTP_H
 
-#ifdef __SUNPRO_C
-#pragma sun ident "$Id$"
-#endif
+#include "ident.h"
+RCSIDH(otp_h, "$Id$");
 
 #include <sys/types.h>
 
index 62e9681..112edb4 100644 (file)
@@ -19,7 +19,8 @@
  * Copyright 2005,2006 TRI-D Systems, Inc.
  */
 
-static const char rcsid[] = "$Id$";
+#include "ident.h"
+RCSID("$Id$")
 
 /* avoid inclusion of these FR headers which conflict w/ OpenSSL */
 #define _LRAD_MD4_H
index b23aa67..2b55535 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef OTP_MPPE_H
 #define OTP_MPPE_H
 
+#include "ident.h"
+RCSIDH(otp_mppe_h, "$Id$")
+
 /* Some hardcoding here ... because not all types have #defines */
 #define PW_MS_CHAP_CHALLENGE  ((311 << 16) | 11)
 #define PW_MS_CHAP_RESPONSE   ((311 << 16) | 1)
index cc90a1c..ba6709e 100644 (file)
@@ -21,7 +21,8 @@
  * Copyright 2006 TRI-D Systems, Inc.
  */
 
-static const char rcsid[] = "$Id$";
+#include "ident.h"
+RCSID("$Id$")
 
 #include "autoconf.h"
 #include "radiusd.h"
index 110b245..ab8dc63 100644 (file)
@@ -21,6 +21,9 @@
 #ifndef OTP_PW_VALID_H
 #define OTP_PW_VALID_H
 
+#include "ident.h"
+RCSIDH(otp_pw_valid_h, "$Id$")
+
 #include <pthread.h>
 #include <sys/types.h>
 #include "extern.h"    /* otp_option_t */
index f809488..f0c9b99 100644 (file)
@@ -25,7 +25,8 @@
  * is not sufficient for X9.9 use.
  */
 
-static const char rcsid[] = "$Id$";
+#include "ident.h"
+RCSID("$Id$")
 
 /* avoid inclusion of these FR headers which conflict w/ OpenSSL */
 #define _LRAD_MD4_H
index 5f2648c..ad96bf8 100644 (file)
@@ -19,7 +19,8 @@
  * Copyright 2005,2006 TRI-D Systems, Inc.
  */
 
-static const char rcsid[] = "$Id$";
+#include "ident.h"
+RCSID("$Id$")
 
 /* avoid inclusion of these FR headers which conflict w/ OpenSSL */
 #define _LRAD_MD4_H
index 4574004..058ddea 100644 (file)
@@ -20,7 +20,8 @@
  * Copyright 2005,2006 TRI-D Systems, Inc.
  */
 
-static const char rcsid[] = "$Id$";
+#include "ident.h"
+RCSID("$Id$")
 
 #include <autoconf.h>
 #include <radiusd.h>
index e1fe562..45f6c8e 100644 (file)
@@ -19,7 +19,8 @@
  * Copyright 2005,2006 TRI-D Systems, Inc.
  */
 
-static const char rcsid[] = "$Id$";
+#include "ident.h"
+RCSID("$Id$")
 
 #include "extern.h"