+2002-07-25 Marcus Brinkmann <marcus@g10code.de>
+
+ * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
+ fopencookie.
+ * vasprintf.c: Update to more recent libiberty version.
+ * debug.h: Replace #elsif with #elif.
+
+ Submitted by Stéphane Corthésy:
+ * util.h (vasprintf): Correct prototype.
+ * encrypt-sign.c: Include <stddef.h>.
+ (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
+ size_t.
+ * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
+ * ath-pth.c: Likewise.
+
2002-07-25 Marcus Brinkmann <marcus@g10code.de>
* wait.c (fdt_global): Make static. Reported by Stéphane
${system_components} \
debug.c debug.h \
gpgme.c version.c errors.c
+libgpgme_la_LDADD = @LIBOBJS@
errors.c : gpgme.h
$(srcdir)/mkerrors < $(srcdir)/gpgme.h > errors.c
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <malloc.h>
+#include <stdlib.h>
#include <errno.h>
#include <pth.h>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <malloc.h>
+#include <stdlib.h>
#include <errno.h>
#include <pthread.h>
#define DEBUG_END(hlp, fmt, arg...) \
_gpgme_debug_add (&(hlp), fmt , ##arg); \
_gpgme_debug_end (&(hlp))
-#elsif 0
+#elif 0
/* Only works in C99. */
#define DEBUG0(fmt) \
_gpgme_debug (1, "%s:%s: " fmt, __FILE__, XSTRINGIFY (__LINE__))
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
encrypt_sign_status_handler (GpgmeCtx ctx, GpgStatusCode code, char *args)
{
char *encrypt_info = 0;
- int encrypt_info_len;
+ size_t encrypt_info_len;
_gpgme_encrypt_status_handler (ctx, code, args);
#ifdef HAVE_CONFIG_H
#if !HAVE_VASPRINTF
#include <stdarg.h>
-int vasprintf (char **result, const char *format, va_list *args);
+int vasprintf (char **result, const char *format, va_list args);
int asprintf (char **result, const char *format, ...);
#endif
int global_total_width;
#endif
-int
-vasprintf (char **result, const char *format, va_list *args)
+static int int_vasprintf (char **, const char *, va_list *);
+
+static int
+int_vasprintf (result, format, args)
+ char **result;
+ const char *format;
+ va_list *args;
{
const char *p = format;
/* Add one to make sure that it is never zero, which might cause malloc
total_width += abs (va_arg (ap, int));
}
else
- total_width += strtoul (p, (char**)&p, 10);
+ total_width += strtoul (p, (char **) &p, 10);
if (*p == '.')
{
++p;
total_width += abs (va_arg (ap, int));
}
else
- total_width += strtoul (p, (char**)&p, 10);
+ total_width += strtoul (p, (char **) &p, 10);
}
while (strchr ("hlL", *p))
++p;
(void) va_arg (ap, char *);
break;
}
+ p++;
}
}
#ifdef TEST
return 0;
}
+int
+vasprintf (result, format, args)
+ char **result;
+ const char *format;
+#if defined (_BSD_VA_LIST_) && defined (__FreeBSD__)
+ _BSD_VA_LIST_ args;
+#else
+ va_list args;
+#endif
+{
+ return int_vasprintf (result, format, &args);
+}
+
int
asprintf (char **buf, const char *fmt, ...)