diff options
author | Stef Walter <stefw@gnome.org> | 2012-06-29 16:10:47 +0200 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2012-06-29 16:10:47 +0200 |
commit | da2606bfbbdbd36d5e42bf2acf614735dfc515d2 (patch) | |
tree | 18b0ce3d3531b00c1f7be217a5da07e5218c7547 | |
parent | 89602ce99feb7e8c5a37634c3f577532f82eddbd (diff) |
Win32 build fixes
* Remove unused functions
* Use getprogname() instead of calc_progname() which no longer exists
* Fix up exporting of functions in the mock module
-rw-r--r-- | common/compat.c | 11 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | p11-kit/util.c | 26 | ||||
-rw-r--r-- | tests/mock-module-ep.c | 1 |
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" |