Changeset: 42d1da43efaa for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=42d1da43efaa Modified Files: common/utils/mcrypt.c common/utils/mutils.c common/utils/mutils.h common/utils/muuid.c gdk/gdk.h gdk/gdk_system.c gdk/gdk_system.h gdk/gdk_utils.c monetdb5/mal/mal_linker.c monetdb5/modules/atoms/batxml.c monetdb5/modules/atoms/uuid.c monetdb5/modules/atoms/xml.c Branch: embedded Log Message:
Less OpenSSL and LibXML diffs (truncated from 515 to 300 lines): diff --git a/common/utils/mcrypt.c b/common/utils/mcrypt.c --- a/common/utils/mcrypt.c +++ b/common/utils/mcrypt.c @@ -382,19 +382,21 @@ mcrypt_hashPassword( #else /* in embedded mode, we don't do MAPI or vaults, therefore we can run without OpenSSL. One build dependency down. */ -#define NO_OPENSSL_FATAL "MonetDB was built without OpenSSL, but what you are trying to do requires it." +#define NO_OPENSSL_FATAL "MonetDB was built without OpenSSL, but what you are trying to do requires it.\n" char* mcrypt_sum_fail(const char *string, size_t len) { (void)string; (void)len; - GDKfatal(NO_OPENSSL_FATAL); + fprintf(stderr, NO_OPENSSL_FATAL); + exit(1); return NULL; } char * mcrypt_getHashAlgorithms(void) { - GDKfatal(NO_OPENSSL_FATAL); + fprintf(stderr, NO_OPENSSL_FATAL); + exit(1); return NULL; } @@ -456,7 +458,8 @@ mcrypt_hashPassword( (void)algo; (void)password; (void)challenge; - GDKfatal(NO_OPENSSL_FATAL); + fprintf(stderr, NO_OPENSSL_FATAL); + exit(1); return NULL; } #endif diff --git a/common/utils/mutils.c b/common/utils/mutils.c --- a/common/utils/mutils.c +++ b/common/utils/mutils.c @@ -472,7 +472,7 @@ get_bin_path(void) { /* getting the path to the executable's binary, isn't all that * simple, unfortunately */ -#if defined(_MSC_VER) /* Windows */ +#if (defined(_MSC_VER) || defined(__MINGW32__)) /* Windows */ if (GetModuleFileName(NULL, _bin_path, (DWORD) sizeof(_bin_path)) != 0) return _bin_path; diff --git a/common/utils/mutils.h b/common/utils/mutils.h --- a/common/utils/mutils.h +++ b/common/utils/mutils.h @@ -44,8 +44,8 @@ mutils_export char *dirname(char *path); #endif -#ifndef S_IRUSR -/* if one doesn't exist, presumably they all don't exist */ +#ifndef S_IWGRP +/* if one doesn't exist, presumably they all don't exist - Not so on MinGW */ #define S_IRUSR 0000400 /* read permission, owner */ #define S_IWUSR 0000200 /* write permission, owner */ #define S_IRGRP 0000040 /* read permission, group */ diff --git a/common/utils/muuid.c b/common/utils/muuid.c --- a/common/utils/muuid.c +++ b/common/utils/muuid.c @@ -17,8 +17,10 @@ # include <uuid/uuid.h> #endif #ifndef HAVE_UUID +#ifdef HAVE_OPENSSL # include <openssl/rand.h> #endif +#endif /** * Shallow wrapper around uuid, that comes up with some random pseudo @@ -42,7 +44,7 @@ generateUUID(void) * format of a UUID to at least return some uniform answer */ char out[37]; unsigned char randbuf[16]; - +#ifdef HAVE_OPENSSL if (RAND_bytes(randbuf, 16) >= 0) { snprintf(out, sizeof(out), "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-" @@ -52,6 +54,7 @@ generateUUID(void) randbuf[8], randbuf[9], randbuf[10], randbuf[11], randbuf[12], randbuf[13], randbuf[14], randbuf[15]); } else { +#endif /* generate something like this: * cefa7a9c-1dd2-11b2-8350-880020adbeef * ("%08x-%04x-%04x-%04x-%012x") */ @@ -61,7 +64,9 @@ generateUUID(void) rand() % 65536, rand() % 65536, rand() % 65536, rand() % 65536, rand() % 65536, rand() % 65536); +#ifdef HAVE_OPENSSL } #endif +#endif return strdup(out); } diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -582,7 +582,7 @@ typedef char *str; # define LL_CONSTANT(val) (val) #elif SIZEOF_LONG==8 # define LL_CONSTANT(val) (val##L) -#elif defined(HAVE_LONG_LONG) +#elif defined(HAVE_LONG_LONG) || defined(__MINGW32__) # define LL_CONSTANT(val) (val##LL) #elif defined(HAVE___INT64) # define LL_CONSTANT(val) (val##i64) diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -150,7 +150,7 @@ GDKlockstatistics(int what) } #endif -#if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER) +#if !defined(HAVE_PTHREAD_H) && (defined(_MSC_VER) || defined(__MINGW32__)) static struct winthread { struct winthread *next; HANDLE hdl; diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h --- a/gdk/gdk_system.h +++ b/gdk/gdk_system.h @@ -94,7 +94,7 @@ gdk_export int MT_join_thread(MT_Id t); /* * @- MT Lock API */ -#if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER) +#if !defined(HAVE_PTHREAD_H) && (defined(_MSC_VER) || defined(__MINGW32__)) typedef HANDLE pthread_mutex_t; typedef void *pthread_mutexattr_t; gdk_export void pthread_mutex_init(pthread_mutex_t *, @@ -290,7 +290,7 @@ gdk_export ATOMIC_TYPE volatile GDKlocks /* * @- MT Semaphore API */ -#if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER) +#if !defined(HAVE_PTHREAD_H) && (defined(_MSC_VER) || defined(__MINGW32__)) typedef HANDLE pthread_sema_t; gdk_export void pthread_sema_init(pthread_sema_t *s, int flag, int nresources); diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c --- a/gdk/gdk_utils.c +++ b/gdk/gdk_utils.c @@ -364,7 +364,7 @@ MT_init(void) if (_MT_pagesize <= 0) _MT_pagesize = 4096; /* default */ -#ifdef _MSC_VER +#if defined(MSC_VER) || defined(__MINGW32__) { MEMORYSTATUSEX memStatEx; diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c --- a/monetdb5/mal/mal_linker.c +++ b/monetdb5/mal/mal_linker.c @@ -96,7 +96,6 @@ getAddress(stream *out, str filename, st (modnme?modnme:"<unknown>"), fcnname); return NULL; } - adr = (MALfcn) dlsym(dl, fcnname); dlclose(dl); if( adr != NULL) diff --git a/monetdb5/modules/atoms/batxml.c b/monetdb5/modules/atoms/batxml.c --- a/monetdb5/modules/atoms/batxml.c +++ b/monetdb5/modules/atoms/batxml.c @@ -23,11 +23,14 @@ */ + #include "monetdb_config.h" #include <gdk.h> #include "ctype.h" #include <string.h> +#ifdef HAVE_LIBXML #include <libxml/parser.h> +#endif #include "mal_interpreter.h" #include "mal_function.h" #include "xml.h" @@ -61,6 +64,7 @@ batxml_export str BATXMLgroup(xml *ret, batxml_export str AGGRsubxmlcand(bat *retval, const bat *bid, const bat *gid, const bat *eid, const bat *sid, const bit *skip_nils); batxml_export str AGGRsubxml(bat *retval, const bat *bid, const bat *gid, const bat *eid, const bit *skip_nils); +#ifdef HAVE_LIBXML #define prepareResult(X,Y,tpe,Z,free) \ (X) = BATnew((Y)->htype, (tpe), BATcount(Y), TRANSIENT); \ @@ -1707,3 +1711,146 @@ BATXMLxquery(bat *ret, const bat *bid, c /* use external library to solve this */ throw(MAL, "xml.xquery", PROGRAM_NYI); } + +#else + +#define NO_LIBXML_FATAL "MonetDB was built without libxml, but what you are trying to do requires it." + +str BATXMLxml2str(bat *ret, const bat *bid) { + (void) ret; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLxmltext(bat *ret, const bat *bid) { + (void) ret; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLstr2xml(bat *ret, const bat *bid) { + (void) ret; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLdocument(bat *ret, const bat *bid) { + (void) ret; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLcontent(bat *ret, const bat *bid) { + (void) ret; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLisdocument(bat *ret, const bat *bid) { + (void) ret; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLelementSmall(bat *ret, const char * const *name, const bat *bid) { + (void) ret; + (void) name; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLoptions(bat *ret, const char * const *name, const char * const *options, const bat *bid) { + (void) ret; + (void) name; + (void) options; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLcomment(bat *ret, const bat *bid) { + (void) ret; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLparse(bat *ret, const char * const *doccont, const bat *bid, const char * const *option) { + (void) ret; + (void) doccont; + (void) bid; + (void) option; + return NO_LIBXML_FATAL; +} +str BATXMLxquery(bat *ret, const bat *bid, const char * const *expr) { + (void) ret; + (void) bid; + (void) expr; + return NO_LIBXML_FATAL; +} +str BATXMLpi(bat *ret, const char * const *tgt, const bat *bid) { + (void) ret; + (void) tgt; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLroot(bat *ret, const bat *bid, const char * const *version, const char * const *standalone) { + (void) ret; + (void) bid; + (void) version; + (void) standalone; + return NO_LIBXML_FATAL; +} +str BATXMLattribute(bat *ret, const char * const *name, const bat *bid) { + (void) ret; + (void) name; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLelement(bat *ret, const char * const *name, xml *ns, xml *attr, const bat *bid) { + (void) ret; + (void) name; + (void) ns; + (void) attr; + (void) bid; + return NO_LIBXML_FATAL; +} +str BATXMLconcat(bat *ret, const bat *bid, const bat *rid) { + (void) ret; + (void) bid; + (void) rid; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list