comparison Modules/python.c @ 49554:26bc0cd0108b

restore compilation on OpenBSD #4146
author Benjamin Peterson <benjamin@python.org>
date Sun, 19 Oct 2008 14:15:00 +0000
parents 1e5b2050ec6a
children a5f0371850ff
comparison
equal deleted inserted replaced
49553:3ff7bb830519 49554:26bc0cd0108b
15 } 15 }
16 #else 16 #else
17 int 17 int
18 main(int argc, char **argv) 18 main(int argc, char **argv)
19 { 19 {
20 wchar_t **argv_copy = PyMem_Malloc(sizeof(wchar_t*)*argc); 20 wchar_t **argv_copy = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*argc);
21 /* We need a second copies, as Python might modify the first one. */ 21 /* We need a second copies, as Python might modify the first one. */
22 wchar_t **argv_copy2 = PyMem_Malloc(sizeof(wchar_t*)*argc); 22 wchar_t **argv_copy2 = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*argc);
23 int i, res; 23 int i, res;
24 char *oldloc; 24 char *oldloc;
25 /* 754 requires that FP exceptions run in "no stop" mode by default, 25 /* 754 requires that FP exceptions run in "no stop" mode by default,
26 * and until C vendors implement C99's ways to control FP exceptions, 26 * and until C vendors implement C99's ways to control FP exceptions,
27 * Python requires non-stop mode. Alas, some platforms enable FP 27 * Python requires non-stop mode. Alas, some platforms enable FP
52 size_t count; 52 size_t count;
53 if (argsize == (size_t)-1) { 53 if (argsize == (size_t)-1) {
54 fprintf(stderr, "Could not convert argument %d to string\n", i); 54 fprintf(stderr, "Could not convert argument %d to string\n", i);
55 return 1; 55 return 1;
56 } 56 }
57 argv_copy[i] = PyMem_Malloc((argsize+1)*sizeof(wchar_t)); 57 argv_copy[i] = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t));
58 argv_copy2[i] = argv_copy[i]; 58 argv_copy2[i] = argv_copy[i];
59 if (!argv_copy[i]) { 59 if (!argv_copy[i]) {
60 fprintf(stderr, "out of memory\n"); 60 fprintf(stderr, "out of memory\n");
61 return 1; 61 return 1;
62 } 62 }