mingw-w64: Patches go upstream

This commit is contained in:
Alexpux
2014-10-22 00:02:34 +04:00
parent c048744c48
commit bde4ee00a4
4 changed files with 6 additions and 108 deletions

View File

@@ -1,34 +0,0 @@
From: Ray Donnelly <mingw.android@gmail.com>
Date: Mon, 20 Oct 2014 12:58:18 +0100
Subject: [PATCH] localtime_r guard to _POSIX or _POSIX_THREAD_SAFE_FUNCTIONS
From http://www.unix.org/whitepapers/reentrant.html
"This is accomplished in the standard by associating the reentrancy
specifications with a separate option, {_POSIX_THREAD_SAFE_FUNCTIONS},
which is declared to be mandatory for implementations supporting the
threads option"
In pthread_unistd.h we define:
_POSIX_THREAD_SAFE_FUNCTIONS 200112L
---
mingw-w64-headers/crt/time.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h
index 5ce5849..b8b5f21 100644
--- a/mingw-w64-headers/crt/time.h
+++ b/mingw-w64-headers/crt/time.h
@@ -169,7 +169,7 @@ char *__cdecl ctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
struct tm *__cdecl gmtime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
struct tm *__cdecl localtime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
-#ifdef _POSIX
+#if defined(_POSIX) || defined(_POSIX_THREAD_SAFE_FUNCTIONS)
#ifdef __GNUC__ /* FIXME: Other compilers that these macros work with? */
#ifndef localtime_r
#define localtime_r(_Time, _Tm) ({ struct tm *___tmp_tm = \
--
2.1.2

View File

@@ -5,7 +5,7 @@ pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git"
replaces="${MINGW_PACKAGE_PREFIX}-${_realname}-svn"
pkgdesc="MinGW-w64 headers for Windows"
_ver_base=4.0.0
pkgver=4.0.0.4306.2905bf8
pkgver=4.0.0.4308.73f412f
pkgrel=1
arch=('any')
url="http://mingw-w64.sourceforge.net"
@@ -15,10 +15,8 @@ makedepends=('git')
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}")
options=('!strip' '!libtool' '!emptydirs')
source=("${_realname}"::"git://git.code.sf.net/p/mingw-w64/mingw-w64"
0001-localtime_r-guard-to-_POSIX-or-_POSIX_THREAD_SAFE_FU.patch)
md5sums=('SKIP'
'38740bd74627626d7d0872042aecb382')
source=("${_realname}"::"git://git.code.sf.net/p/mingw-w64/mingw-w64")
md5sums=('SKIP')
pkgver() {
cd "$srcdir/$_realname"
@@ -27,7 +25,6 @@ pkgver() {
prepare() {
cd ${srcdir}/${_realname}
git am ${srcdir}/0001-localtime_r-guard-to-_POSIX-or-_POSIX_THREAD_SAFE_FU.patch
}
build() {

View File

@@ -1,62 +0,0 @@
From aa03fe920252887a535205d392abb6b363eb006f Mon Sep 17 00:00:00 2001
From: martell <martellmalone@gmail.com>
Date: Sat, 18 Oct 2014 22:45:38 +0100
Subject: [PATCH] winpthreads: removed legacy time functions from pthread.h
---
mingw-w64-libraries/winpthreads/include/pthread.h | 39 -----------------------
1 file changed, 39 deletions(-)
diff --git a/mingw-w64-libraries/winpthreads/include/pthread.h b/mingw-w64-libraries/winpthreads/include/pthread.h
index 2029713..76ded6e 100644
--- a/mingw-w64-libraries/winpthreads/include/pthread.h
+++ b/mingw-w64-libraries/winpthreads/include/pthread.h
@@ -413,45 +413,6 @@ int WINPTHREAD_API pthread_rwlockattr_getpshared(pthread_
int WINPTHREAD_API pthread_rwlockattr_init(pthread_rwlockattr_t *a);
int WINPTHREAD_API pthread_rwlockattr_setpshared(pthread_rwlockattr_t *a, int s);
-/* Recursive API emulation. */
-#undef localtime_r
-#define localtime_r(_Time, _Tm) ({ struct tm *___tmp_tm; \
- pthread_testcancel(); \
- ___tmp_tm = localtime((_Time));\
- if (___tmp_tm) { \
- *(_Tm) = *___tmp_tm; \
- ___tmp_tm = (_Tm); \
- } \
- ___tmp_tm; })
-
-#undef gmtime_r
-#define gmtime_r(_Time,_Tm) ({ struct tm *___tmp_tm; \
- pthread_testcancel(); \
- ___tmp_tm = gmtime((_Time)); \
- if (___tmp_tm) { \
- *(_Tm) = *___tmp_tm; \
- ___tmp_tm = (_Tm); \
- } \
- ___tmp_tm; })
-
-#undef ctime_r
-#define ctime_r(_Time,_Str) ({ char *___tmp_tm; \
- pthread_testcancel(); \
- ___tmp_tm = ctime((_Time)); \
- if (___tmp_tm) \
- ___tmp_tm = \
- strcpy((_Str),___tmp_tm); \
- ___tmp_tm; })
-
-#undef asctime_r
-#define asctime_r(_Tm, _Buf) ({ char *___tmp_tm; \
- pthread_testcancel(); \
- ___tmp_tm = asctime((_Tm)); \
- if (___tmp_tm) \
- ___tmp_tm = \
- strcpy((_Buf),___tmp_tm);\
- ___tmp_tm; })
-
#ifndef rand_r
#define rand_r(__seed) (__seed == __seed ? rand () : rand ())
#endif
--
2.1.2

View File

@@ -4,7 +4,7 @@
_realname=winpthreads
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-git" "${MINGW_PACKAGE_PREFIX}-libwinpthread-git")
_ver_base=4.0.0
pkgver=4.0.0.4305.9bd8fe9
pkgver=4.0.0.4308.73f412f
pkgrel=1
pkgdesc="MinGW-w64 winpthreads library"
arch=('any')
@@ -13,10 +13,8 @@ license=('custom')
groups=("${MINGW_PACKAGE_PREFIX}-toolchain" "${MINGW_PACKAGE_PREFIX}")
makedepends=("subversion" "${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-binutils" "${MINGW_PACKAGE_PREFIX}-crt" "${MINGW_PACKAGE_PREFIX}-headers")
options=('strip' '!buildflags' 'staticlibs' '!emptydirs' '!debug')
source=("${_realname}"::"git://git.code.sf.net/p/mingw-w64/mingw-w64"
"0001-winpthreads-removed-legacy-time-functions-from-pthre.patch")
md5sums=('SKIP'
'024c5ec943f13e6b5d786f78654a0b07')
source=("${_realname}"::"git://git.code.sf.net/p/mingw-w64/mingw-w64")
md5sums=('SKIP')
pkgver() {
cd "${srcdir}/${_realname}"
@@ -25,7 +23,6 @@ pkgver() {
prepare() {
cd "${srcdir}/${_realname}"
git am "${srcdir}/0001-winpthreads-removed-legacy-time-functions-from-pthre.patch"
}
build() {