Mercurial > hg > mxe-octave-anirudha
annotate src/popt-1-win32.patch @ 3173:33ba1ba99057
Update fontconfig to 2.10.93 (required by current Pango)
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Tue, 23 Jul 2013 22:29:33 -0400 |
parents | 99516e73b368 |
children |
rev | line source |
---|---|
2333
f653602a0500
Rebrand to new project name MXE
Volker Grabsch <vog@notjusthosting.com>
parents:
955
diff
changeset
|
1 This file is part of MXE. |
2353
99516e73b368
Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents:
2333
diff
changeset
|
2 See index.html for further information. |
414
d2a6561bcb6d
add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents:
395
diff
changeset
|
3 |
955 | 4 diff -urN a/popt.c b/popt.c |
5 --- a/popt.c 2010-01-19 01:39:10.000000000 +0100 | |
6 +++ b/popt.c 2010-05-12 00:15:14.959504505 +0200 | |
7 @@ -972,6 +972,21 @@ | |
395
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
8 /*@=unqualifiedtrans =nullstate@*/ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
9 } |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
10 |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
11 +/* Win32 typically lacks random/srandom, but has rand/srand which |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
12 + * produces frankly rubbish random numbers and has RAND_MAX = 0x7FFF. |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
13 + */ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
14 +#ifndef HAVE_RANDOM |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
15 +static int |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
16 +random () |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
17 +{ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
18 + return rand () << 15 | rand (); |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
19 +} |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
20 +#endif |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
21 + |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
22 +#ifndef HAVE_SRANDOM |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
23 +#define srandom srand |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
24 +#endif |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
25 + |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
26 /*@unchecked@*/ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
27 static unsigned int seed = 0; |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
28 |
955 | 29 diff -urN a/poptconfig.c b/poptconfig.c |
30 --- a/poptconfig.c 2009-05-20 15:18:07.000000000 +0200 | |
31 +++ b/poptconfig.c 2010-05-12 00:15:14.959504505 +0200 | |
395
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
32 @@ -141,18 +141,23 @@ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
33 int poptSaneFile(const char * fn) |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
34 { |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
35 struct stat sb; |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
36 +#ifdef HAVE_GETUID |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
37 uid_t uid = getuid(); |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
38 - |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
39 +#endif |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
40 if (stat(fn, &sb) == -1) |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
41 return 1; |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
42 +#ifdef HAVE_GETUID |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
43 if ((uid_t)sb.st_uid != uid) |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
44 return 0; |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
45 +#endif |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
46 if (!S_ISREG(sb.st_mode)) |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
47 return 0; |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
48 +#ifdef HAVE_GETUID |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
49 /*@-bitwisesigned@*/ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
50 if (sb.st_mode & (S_IWGRP|S_IWOTH)) |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
51 return 0; |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
52 /*@=bitwisesigned@*/ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
53 +#endif |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
54 return 1; |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
55 } |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
56 |
955 | 57 diff -urN a/popthelp.c b/popthelp.c |
58 --- a/popthelp.c 2009-08-28 02:06:33.000000000 +0200 | |
59 +++ b/popthelp.c 2010-05-12 00:15:14.964949157 +0200 | |
395
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
60 @@ -12,8 +12,10 @@ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
61 |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
62 #define POPT_USE_TIOCGWINSZ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
63 #ifdef POPT_USE_TIOCGWINSZ |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
64 +#ifdef HAVE_SYS_IOCTL_H |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
65 #include <sys/ioctl.h> |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
66 #endif |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
67 +#endif |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
68 |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
69 #define POPT_WCHAR_HACK |
efb6136728a8
new package: popt (by Mark Brand)
Volker Grabsch <vog@notjusthosting.com>
parents:
diff
changeset
|
70 #ifdef POPT_WCHAR_HACK |