summaryrefslogtreecommitdiff
path: root/adhoc.cpp.proto
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-02-02 13:44:49 -0500
committerJeffrey Walton <noloader@gmail.com>2016-02-02 13:44:49 -0500
commit82d8c4a8b5cb4ebeb0e1ffeef3550c1cb23909a4 (patch)
tree67249576f5fbc32bcd352848980ffc23d7e08de6 /adhoc.cpp.proto
parent4b5677dcfa2b994a95fb98a11a0f14785cd7aa20 (diff)
downloadcryptopp-git-82d8c4a8b5cb4ebeb0e1ffeef3550c1cb23909a4.tar.gz
Fixed Asan and UBsan detection code. It appears GCC package maintainers are not going to fix the missing libraries
Diffstat (limited to 'adhoc.cpp.proto')
-rw-r--r--adhoc.cpp.proto15
1 files changed, 15 insertions, 0 deletions
diff --git a/adhoc.cpp.proto b/adhoc.cpp.proto
index ffe8e3b8..c8d59f94 100644
--- a/adhoc.cpp.proto
+++ b/adhoc.cpp.proto
@@ -12,6 +12,19 @@
USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)
+// Used for testing the compiler and linker in cryptest.sh
+
+#if defined(CRYPTOPP_ADHOC_MAIN)
+
+int main(int argc, char *argv[])
+{
+ CRYPTOPP_UNUSED(argc), CRYPTOPP_UNUSED(argv);
+ return 0;
+}
+
+// Classic use of adhoc to setup calling convention
+#else
+
extern int (*AdhocTest)(int argc, char *argv[]);
int MyAdhocTest(int argc, char *argv[])
@@ -21,3 +34,5 @@ int MyAdhocTest(int argc, char *argv[])
}
static int s_i = (AdhocTest = &MyAdhocTest, 0);
+
+#endif \ No newline at end of file