summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/compat.c11
-rw-r--r--configure.ac2
-rw-r--r--p11-kit/util.c26
-rw-r--r--tests/mock-module-ep.c1
4 files changed, 10 insertions, 30 deletions
diff --git a/common/compat.c b/common/compat.c
index 4c8016b..e1f7532 100644
--- a/common/compat.c
+++ b/common/compat.c
@@ -36,6 +36,9 @@
#include "compat.h"
+#include <stdlib.h>
+#include <string.h>
+
#ifndef HAVE_GETPROGNAME
#ifdef OS_UNIX
@@ -166,7 +169,7 @@ verrc (int eval,
{
if (err_file == 0)
err_set_file((FILE *)0);
- fprintf(err_file, "%s: ", calc_prog_name());
+ fprintf(err_file, "%s: ", getprogname ());
if (fmt != NULL) {
vfprintf(err_file, fmt, ap);
fprintf(err_file, ": ");
@@ -193,7 +196,7 @@ verrx (int eval,
{
if (err_file == 0)
err_set_file((FILE *)0);
- fprintf(err_file, "%s: ", calc_prog_name());
+ fprintf(err_file, "%s: ", getprogname ());
if (fmt != NULL)
vfprintf(err_file, fmt, ap);
fprintf(err_file, "\n");
@@ -235,7 +238,7 @@ vwarnc (int code,
{
if (err_file == 0)
err_set_file((FILE *)0);
- fprintf(err_file, "%s: ", calc_prog_name());
+ fprintf(err_file, "%s: ", getprogname ());
if (fmt != NULL)
{
vfprintf(err_file, fmt, ap);
@@ -260,7 +263,7 @@ vwarnx (const char *fmt,
{
if(err_file == 0)
err_set_file((FILE*)0);
- fprintf(err_file, "%s: ", calc_prog_name());
+ fprintf(err_file, "%s: ", getprogname ());
if(fmt != NULL)
vfprintf(err_file, fmt, ap);
fprintf(err_file, "\n");
diff --git a/configure.ac b/configure.ac
index 401265f..ac39567 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,8 @@ if test "$os_unix" = "yes"; then
[AC_DEFINE(HAVE___PROGNAME, [1], [Whether __progname available])])
fi
+AC_CHECK_LIB(intl, dgettext)
+
# ------------------------------------------------------------------------------
# PKCS#11 Directories
diff --git a/p11-kit/util.c b/p11-kit/util.c
index f8ec1e6..ccc954c 100644
--- a/p11-kit/util.c
+++ b/p11-kit/util.c
@@ -457,32 +457,6 @@ DllMain (HINSTANCE instance,
return TRUE;
}
-extern char **__argv;
-
-static char *
-get_default_progname (void)
-{
- const char *name;
- const char *p;
- char *progname;
- size_t length;
-
- name = __argv[0];
- if (name == NULL)
- return NULL;
-
- p = strrchr (name, '\\');
- if (p != NULL)
- name = p + 1;
-
- progname = strdup (name);
- length = strlen (progname);
- if (length > 4 && _stricmp(progname + (length - 4), ".exe"))
- progname[length - 4] = '\0';
-
- return progname;
-}
-
#endif /* OS_WIN32 */
/* This is the progname that we think of this process as. */
diff --git a/tests/mock-module-ep.c b/tests/mock-module-ep.c
index 69542bb..c784546 100644
--- a/tests/mock-module-ep.c
+++ b/tests/mock-module-ep.c
@@ -34,6 +34,7 @@
#include "config.h"
+#define CRYPTOKI_EXPORTS 1
#include "pkcs11.h"
#include "mock-module.h"