kernel crypto: Tidy up includes
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 1 Mar 2011 14:35:35 +0000 (14:35 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 3 Mar 2011 14:39:32 +0000 (06:39 -0800)
Don't include the whole of afsincludes.h when building our kernel
crypto interface, as it can lead to symbol collisions on Fedora 10 and
later.

Instead, just include rx/rx.h, which is sadly required to get an
osi_Assert prototype, and explicitly prototype our osi_readRandom()
function

Change-Id: I55d03d76ac0cc8f490aa30f6986115cefae8f427
Reviewed-on: http://gerrit.openafs.org/4101
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/crypto/hcrypto/kernel/config.h

index 8aa71ce..29e9947 100644 (file)
 
 #include "afs/stds.h"
 #include "afs/sysincludes.h"
-#include "afsincludes.h"
 
+/* Asserting is a mess - we need the RX headers in order to get a definition
+ * for osi_Assert */
 #define assert osi_Assert
+#include <rx/rx.h>
+
+/* hcrypto uses "static inline", which isn't supported by some of our
+ * compilers */
+#if !defined(inline) && !defined(__GNUC__)
+#define inline
+#endif
 
 /* We need wrappers for the various memory management functions */
 #define calloc _afscrypto_calloc
@@ -46,3 +54,7 @@ char * _afscrypto_strdup(const char *);
 
 #define realloc _afscrypto_realloc
 void * _afscrypto_realloc(void *, size_t);
+
+/* osi_readRandom is also prototyped in afs_prototypes.h, but pulling that in
+ * here creates loads of additional dependencies */
+extern int osi_readRandom(void *, afs_size_t);