aboutsummaryrefslogtreecommitdiffstats
path: root/src/gen-posix-lock-obj.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-07-12Fix build without threadsYann E. MORIN1-1/+3
* src/gen-posix-lock-obj.c: properly guard inclusioin of pthread.h * tests/t-lock.c: likewise * tests/t-poll.c: likewise -- Although ./configure checks for thread support, gen-posix-lock-obj and two tests still include pthread.h unconditionally. Guard that inclusion using the same condition as all other uses of pthread-related code. Signed-off-by: "Yann E. MORIN" <[email protected]>
2016-04-25Fix for HPPA.NIIBE Yutaka1-3/+10
* configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): Revert. * src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Revert. * src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Revert. -- Signed-off-by: NIIBE Yutaka <[email protected]> This fixes commit 5168b97. I considered wrongly that long double were 128-bit in HPPA. Currently, all that we can do for HPPA is assuming GCC and use its extension of "aligned" attribute.
2016-03-03Fix detecting Solaris operating system.NIIBE Yutaka1-1/+2
* src/gen-posix-lock-obj.c (USE_DOUBLE_FOR_ALIGNMENT): Check for the macro __sun. -- Signed-off-by: NIIBE Yutaka <[email protected]> This fixes commit 5168b97 and 34b0714. Thanks to Ibraheem Saleh and Thomas Klausner for testing. Thanks to Tom G. Christensen for suggesting the fix with the useful link: https://sourceforge.net/p/predef/wiki/Home/ Thanks to Nelson H. F. Beebe to inform the tool: http://www.math.utah.edu/~beebe/cc-defs GnuPG-bug-id: 2144
2016-03-01Fix for Solaris.NIIBE Yutaka1-1/+1
* src/gen-posix-lock-obj.c (USE_DOUBLE_FOR_ALIGNMENT): Check LP64. -- Signed-off-by: NIIBE Yutaka <[email protected]> This fixes commit 5168b97.
2016-02-26Add support for Solaris, fixing HPPA.NIIBE Yutaka1-9/+11
* configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): Remove. (LIB_SCHED_YIELD): New. Check sched_yield in -lrt. * src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Remove. (USE_DOUBLE_FOR_ALIGNMENT, USE_LONG_DOUBLE_FOR_ALIGNMENT): New. * src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Update. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2016-02-08Convert http links to https where possible in the source.Daniel Kahn Gillmor1-1/+1
-- * use https for bug reporting * in comments and docs, use https to refer to: - www.gnu.org - creativecommons.org - translationproject.org - mail.gnome.org - www.perl.org - www.ctan.org - www.cl.cam.ac.uk - www.ntg.nl - cygwin.com - www.ethnologue.com
2015-06-15Allow building with --disable-threads.Werner Koch1-14/+46
* src/posix-lock-obj.h (LOCK_ABI_NOT_AVAILABLE): New. (LOCK_ABI_VERSION): Define depending on USE_POSIX_THREADS. (_gpgrt_lock_t) [!USE_POSIX_THREADS]: Do not define the union. * src/gen-posix-lock-obj.c: Take care of USE_POSIX_THREADS. * src/posix-lock.c (_gpgrt_lock_init, _gpgrt_lock_lock) (_gpgrt_lock_trylock, _gpgrt_lock_unlock) (_gpgrt_lock_destroy): Return success for a no-threads version. * tests/t-lock.c: Disable tests if threads are not available. * src/mkheader.c (main): Add NO-THREADS to the printed comment. * configure.ac: Show NO-TRHEADS in the final summary. -- Warning: Using --disable-threads creates a different ABI which we can't encode in the the cpu-vendor-os triplet. The run time checks should detect this and abort the process. Signed-off-by: Werner Koch <[email protected]>
2014-08-05Use 16 byte alignment for hppa-unknown-linux-gnu.Werner Koch1-0/+19
* configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): New. * src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Set for HPPA-Linux. (main): Enforce alignment if needed. * src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Use 16 byte alignment. -- Debian-bug-id: 757060
2014-06-25Add missing prototype for build tool.Werner Koch1-0/+1
* src/gen-posix-lock-obj.c: Include string.h. -- string.h is required for strerror ().
2014-01-28Fix the name of the file in the comment of the output.Werner Koch1-1/+1
* src/gen-posix-lock-obj.c (main): Chnage comment in created file.
2014-01-17Move version number first in the Posix lock-obj.Werner Koch1-11/+12
* src/posix-lock-obj.h (_gpgrt_lock_t): Swap VERS and MTX and put MTX into a union. * src/posix-lock.c (gpgrt_lock_lock): Adjust for this change. * src/gen-posix-lock-obj.c (main): Change output accordingly. Signed-off-by: Werner Koch <[email protected]>
2014-01-17Extend the platform dependent build rules.Werner Koch1-1/+16
* src/mkheader.c (mk_include_name): New. (include_file): Implement '&' substitution. (try_include_file): New. (write_special): Use try_include_file and syscfg/. (main): Add a new arg. * configure.ac (CROSS_COMPILING): New am_conditional. (HOST_TRIPLET_STRING): New ac_define. * src/gen-posix-lock-obj.c (main): Print the host triplet. * src/w32-lock-obj-pub.in: Move to ... * src/syscfg/lock-obj-pub.mingw32.h: here. * src/Makefile.am (lock_obj_pub): New. (pre_mkheader_cmds): New. (gpg-error.h): Run pre_mkheader_cmds. (parts_of_gpg_error_h, lock-obj-pub.native.h): Do not use when cross-compiling. Signed-off-by: Werner Koch <[email protected]>
2014-01-16Add gpgrt_lock_ functions.Werner Koch1-0/+95
* src/gpg-error.h.in (GPGRT_LOCK_DEFINE): New. (gpgrt_lock_init): New. (gpgrt_lock_lock): New. (gpgrt_lock_unlock): New. (gpgrt_lock_destroy): New. (gpgrt_yield): New. * src/gpg-error.def.in: Add new functions. * m4/lock.m4, m4/threadlib.m4: New. Taken from current gnulib. * configure.ac: Call gl_LOCK. Check size of pthread_mutex_t. Add LIBTHREAD to GPG_ERROR_CONFIG_LIBS. * src/err-codes.h.in (GPG_ERR_INV_LOCK_OBJ): New. * src/gen-posix-lock-obj.c: New. * src/gen-w32-lock-obj.c: New. * src/lock.h, src/thread.h: New. * src/posix-lock-obj.h, src/w32-lock-obj.h: New. * src/posix-lock.c, src/w32-lock.c: New. * src/posix-thread.c, src/w32-thread.c: * src/w32-lock-obj-pub.in: New. * src/mkheader.c (include_file): Support build time include files. (write_special): Add keyword "include:lock-obj". * src/Makefile.am: (posix-lock-obj-pub.in): New rule. (noinst_PROGRAMS): Add gen-*-lock-obj helpers. * tests/t-common.h: New. * tests/t-lock.c: New. * tests/Makefile.am (t_lock_LDADD): Add new test. -- This patch introduces the gpgrt_ functions which will be extended over time to provide a library of commonly used code in GnuPG and Libgcrypt. Having them in a library named libgpg-error is a misnomer but this way we can achieve a smooth upgrade path. In contrasts to other GnuPG libraries, the gpgrt_ functions return a simple gpg_err_code_t and not gpg_error_t. The rationale for this is that a source of error identifier does not make sense here; it is better to use the source of error identifier of the caller. This can easily be achieved in a component by wrapping these function in a gpg_error macro/inline. There is no cross-compiling support for Posix platforms; the gen-posix-lock-obj tool must be run on the target system. Note that the gen-w32-lock-obj tool is not needed at build time but was used to figure out ABI definitions for Windows. Signed-off-by: Werner Koch <[email protected]>