1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

common: Remove libjnlib-config.h (jnlib merge).

* common/libjnlib-config.h: Remove.
* common/common-defs.h (getenv) [HAVE_GETENV]: New.  From removed
header.
(getpid) [HAVE_W32CE_SYSTEM]: New.  From removed header.
* common/argparse.c: Include util.h and common-defs.h.  Replace
jnlib_ macro names for non-GNUPG builds by x* names.
* common/dotlock.c: Ditto.
* common/logging.c: Include util.h and common-defs.h.  Replace jnlib_
symbol names by x* names.
* common/strlist.c: Ditto.
* common/utf8conv.c: Ditto.
* common/w32-reg.c: Ditto.
* common/mischelp.c: Ditto.  Also remove _jnlib_free.
* common/stringhelp.c: Ditto.
(JNLIB_LOG_WITH_PREFIX): Do not depend on this macro.
* common/logging.h (JNLIB_LOG_WITH_PREFIX): Do not depend on this
macro.
--

This is part 1 of the patches to merge the jnlib files into common/.
It does not make much sense to keep jnlib/ files separate.  They are
not often use elsewhere and maintaining the complex marcos stuff is
too troublesome for the future.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-04-24 15:19:10 +02:00
parent 154f3ed2bf
commit 17bcd08708
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
15 changed files with 197 additions and 324 deletions

View file

@ -42,22 +42,13 @@
#endif /*!HAVE_W32_SYSTEM*/
#include <errno.h>
#include "libjnlib-config.h"
#include "util.h"
#include "common-defs.h"
#include "stringhelp.h"
#include "utf8conv.h"
#include "mischelp.h"
/* Because we can't use our jnlib_free macro in inline functions we
provide this wrapper. */
void
_jnlib_free (void *p)
{
if (p)
jnlib_free (p);
}
/* Check whether the files NAME1 and NAME2 are identical. This is for
example achieved by comparing the inode numbers of the files. */
int
@ -81,7 +72,7 @@ same_file_p (const char *name1, const char *name2)
file1 = CreateFile (wname, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
else
file1 = INVALID_HANDLE_VALUE;
jnlib_free (wname);
xfree (wname);
}
#else
file1 = CreateFile (name1, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
@ -97,7 +88,7 @@ same_file_p (const char *name1, const char *name2)
file2 = CreateFile (wname, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
else
file2 = INVALID_HANDLE_VALUE;
jnlib_free (wname);
xfree (wname);
}
#else
file2 = CreateFile (name2, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
@ -159,7 +150,7 @@ timegm (struct tm *tm)
/* System time is UTC thus the conversion is pretty easy. */
if (!SystemTimeToFileTime (&st, &ft))
{
jnlib_set_errno (EINVAL);
gpg_err_set_errno (EINVAL);
return (time_t)(-1);
}