ossp-pkg/lmtp2nntp/lmtp2nntp.c 1.46 -> 1.47
--- lmtp2nntp.c 2001/09/10 06:54:06 1.46
+++ lmtp2nntp.c 2001/09/10 10:16:05 1.47
@@ -39,6 +39,22 @@
#include "shpat_match.h"
#include "l2.h"
+/* library version check (compile-time) */
+#define L2_VERSION_HEX_REQ 0x001200
+#define L2_VERSION_STR_REQ "0.1.0"
+#define STR_VERSION_HEX_REQ 0x009205
+#define STR_VERSION_STR_REQ "0.9.5"
+#ifdef L2_VERSION_HEX
+#if L2_VERSION_HEX < L2_VERSION_HEX_REQ
+#error "require a newer version of OSSP L2"
+#endif
+#endif
+#ifdef STR_VERSION_HEX
+#if STR_VERSION_HEX < STR_VERSION_HEX_REQ
+#error "require a newer version of OSSP Str"
+#endif
+#endif
+
/* own headers */
#include "lmtp2nntp.h"
#ifdef HAVE_CONFIG_H
@@ -257,6 +273,16 @@
l2_channel_t *chBuf;
l2_channel_t *chFile;
+ /* library version check (run-time) */
+ if (l2_version.v_hex < L2_VERSION_HEX_REQ) {
+ fprintf(stderr, "require at least OSSP L2 >= %s\n", L2_VERSION_STR_REQ);
+ exit(ERR_EXECUTION);
+ }
+ if (str_version.v_hex < STR_VERSION_HEX_REQ + 1) {
+ fprintf(stderr, "require at least OSSP Str >= %s\n", STR_VERSION_STR_REQ);
+ exit(ERR_EXECUTION);
+ }
+
/* create application context */
if ((ctx = (lmtp2nntp_t *)malloc(sizeof(lmtp2nntp_t))) == NULL)
exit(ERR_EXECUTION);
|
|