# HG changeset patch # User Carl Byington # Date 1229025502 28800 # Node ID e213bfcf9aa73d88d405582e166f47de220d5b7c # Parent f04499f1ef9063507af7ad90a0f4073ece3cd2ca patch from Chris Eagle to build on cygwin diff -r f04499f1ef90 -r e213bfcf9aa7 AUTHORS --- a/AUTHORS Thu Dec 04 10:46:42 2008 -0800 +++ b/AUTHORS Thu Dec 11 11:58:22 2008 -0800 @@ -23,3 +23,4 @@ Bharath Acharya Robert Harris David Cuadrado + Chris Eagle diff -r f04499f1ef90 -r e213bfcf9aa7 ChangeLog --- a/ChangeLog Thu Dec 04 10:46:42 2008 -0800 +++ b/ChangeLog Thu Dec 11 11:58:22 2008 -0800 @@ -1,3 +1,7 @@ +LibPST 0.6.24 (2008-12-11) +=============================== + * patch from Chris Eagle to build on cygwin + LibPST 0.6.23 (2008-12-04) =============================== * bump version to avoid cvs tagging mistake in fedora diff -r f04499f1ef90 -r e213bfcf9aa7 NEWS --- a/NEWS Thu Dec 04 10:46:42 2008 -0800 +++ b/NEWS Thu Dec 11 11:58:22 2008 -0800 @@ -1,3 +1,4 @@ +0.6.24 2008-12-11 patch from Chris Eagle to build on cygwin 0.6.23 2008-12-04 bump version to avoid cvs tagging mistake in fedora 0.6.22 2008-11-28 process emails with type PST_TYPE_OTHER, fix malloc error and possible segfault 0.6.21 2008-10-21 fix title bug with old schema in pst2ldif, also escape commas in distinguished names per rfc4514. diff -r f04499f1ef90 -r e213bfcf9aa7 configure.in --- a/configure.in Thu Dec 04 10:46:42 2008 -0800 +++ b/configure.in Thu Dec 11 11:58:22 2008 -0800 @@ -1,5 +1,5 @@ AC_PREREQ(2.59) -AC_INIT(libpst,0.6.23,carl@five-ten-sg.com) +AC_INIT(libpst,0.6.24,carl@five-ten-sg.com) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADER([config.h]) @@ -88,6 +88,31 @@ AC_MSG_WARN([This should be building on Mac OSX, adding /usr/lib to the library path]) fi +AC_MSG_CHECKING([if iconv uses const arguments]) +AC_LANG_PUSH([C++]) +AC_COMPILE_IFELSE([ + #include + int main(int argc, char **argv) + { + size_t inlen = 100; + char buffer[[inlen]]; + char *p = buffer; + size_t utf8_len = 2 * inlen + 1; + char utf8_buffer[[utf8_len]]; + char *utf8_p = utf8_buffer; + iconv_t cd = 0; + iconv(cd, (const char**)&p, &inlen, &utf8_p, &utf8_len); + } + ], + [AC_DEFINE(ICONV_CONST,const,[do we have const headers]) + AC_MSG_RESULT([yes]) + ], + [AC_DEFINE(ICONV_CONST,,[do we have const headers]) + AC_MSG_RESULT([no]) + ]) +AC_LANG_POP([C++]) + + # The following lines adds the --enable-pst-debug option to configure: # # Give the user the choice to enter one of these: diff -r f04499f1ef90 -r e213bfcf9aa7 libpst.spec.in --- a/libpst.spec.in Thu Dec 04 10:46:42 2008 -0800 +++ b/libpst.spec.in Thu Dec 11 11:58:22 2008 -0800 @@ -47,6 +47,9 @@ %changelog +* Thu Dec 11 2008 Carl Byington - 0.6.24-1 +- patch from Chris Eagle to build on cygwin + * Thu Dec 04 2008 Carl Byington - 0.6.23-1 - bump version to avoid cvs tagging mistake in fedora diff -r f04499f1ef90 -r e213bfcf9aa7 src/libpst.c --- a/src/libpst.c Thu Dec 04 10:46:42 2008 -0800 +++ b/src/libpst.c Thu Dec 11 11:58:22 2008 -0800 @@ -493,8 +493,7 @@ typedef struct pst_x_attrib { - uint16_t extended; - uint16_t zero; + uint32_t extended; uint16_t type; uint16_t map; } pst_x_attrib; @@ -560,8 +559,7 @@ } memcpy(&xattrib, &(buffer[bptr]), sizeof(xattrib)); - LE16_CPU(xattrib.extended); - LE16_CPU(xattrib.zero); + LE32_CPU(xattrib.extended); LE16_CPU(xattrib.type); LE16_CPU(xattrib.map); bptr += sizeof(xattrib); @@ -572,8 +570,8 @@ ptr->type = xattrib.type; ptr->map = xattrib.map+0x8000; ptr->next = NULL; - DEBUG_INDEX(("xattrib: ext = %#hx, zero = %#hx, type = %#hx, map = %#hx\n", - xattrib.extended, xattrib.zero, xattrib.type, xattrib.map)); + DEBUG_INDEX(("xattrib: ext = %#x, type = %#hx, map = %#hx\n", + xattrib.extended, xattrib.type, xattrib.map)); err=0; if (xattrib.type & 0x0001) { // if the Bit 1 is set // pointer to Unicode field in buffer @@ -623,8 +621,7 @@ ptr = NULL; } memcpy(&xattrib, &(buffer[bptr]), sizeof(xattrib)); - LE16_CPU(xattrib.extended); - LE16_CPU(xattrib.zero); + LE32_CPU(xattrib.extended); LE16_CPU(xattrib.type); LE16_CPU(xattrib.map); bptr += sizeof(xattrib); diff -r f04499f1ef90 -r e213bfcf9aa7 src/pst2ldif.cpp --- a/src/pst2ldif.cpp Thu Dec 04 10:46:42 2008 -0800 +++ b/src/pst2ldif.cpp Thu Dec 11 11:58:22 2008 -0800 @@ -371,7 +371,7 @@ iconv(cd, NULL, NULL, NULL, NULL); p = buffer; - int ret = iconv(cd, &p, &inlen, &utf8_p, &utf8_len); + int ret = iconv(cd, (ICONV_CONST char**)&p, &inlen, &utf8_p, &utf8_len); if (ret >= 0) { *utf8_p = 0; @@ -657,7 +657,7 @@ } -int usage() { +int32_t usage() { version(); printf("Usage: %s [OPTIONS] {PST FILENAME}\n", prog_name); printf("OPTIONS:\n"); @@ -673,7 +673,7 @@ } -int version() { +int32_t version() { printf("pst2ldif v%s\n", VERSION); #if BYTE_ORDER == BIG_ENDIAN printf("Big Endian implementation being used.\n"); @@ -745,7 +745,7 @@ utf8_buffer = (char *)malloc(utf8_len); utf8_p = utf8_buffer; iconv(cd, NULL, NULL, NULL, NULL); - if (iconv(cd, &p, &inlen, &utf8_p, &utf8_len) >= 0) { + if (iconv(cd, (ICONV_CONST char**)&p, &inlen, &utf8_p, &utf8_len) >= 0) { *utf8_p = 0; value = utf8_buffer; }