void-packages/srcpkgs/mysql++/patches/01-fix-cross.patch
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

30 lines
731 B
Diff

Index: lib/datetime.cpp
==================================================================
--- a/lib/datetime.cpp
+++ b/lib/datetime.cpp
@@ -30,10 +30,11 @@
#include "datetime.h"
#include "stream2string.h"
#include <iomanip>
+#include <cstring>
#include <stdlib.h>
#include <time.h>
using namespace std;
@@ -51,11 +52,11 @@
localtime_r(&t, ptm);
#else
// No explicitly thread-safe localtime() replacement found. This
// may still be thread-safe, as some C libraries take special steps
// within localtime() to get thread safety, such as TLS.
- memcpy(ptm, localtime(&t), sizeof(tm));
+ std::memcpy(ptm, localtime(&t), sizeof(tm));
#endif
}
std::ostream& operator <<(std::ostream& os, const Date& d)