comparison Modules/python.c @ 84708:4c1945554edb

Fix a compiler warning on FreeBSD Modules/python.c:40: warning: ISO C90 forbids mixed declarations and code
author Victor Stinner <victor.stinner@gmail.com>
date Thu, 18 Jul 2013 02:43:47 +0200
parents b583fd54c8d6
children 386ab2c12301
comparison
equal deleted inserted replaced
84707:ddff866d820d 84708:4c1945554edb
21 wchar_t **argv_copy; 21 wchar_t **argv_copy;
22 /* We need a second copy, as Python might modify the first one. */ 22 /* We need a second copy, as Python might modify the first one. */
23 wchar_t **argv_copy2; 23 wchar_t **argv_copy2;
24 int i, res; 24 int i, res;
25 char *oldloc; 25 char *oldloc;
26 #ifdef __FreeBSD__
27 fp_except_t m;
28 #endif
26 29
27 argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); 30 argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1));
28 argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); 31 argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1));
29 if (!argv_copy || !argv_copy2) { 32 if (!argv_copy || !argv_copy2) {
30 fprintf(stderr, "out of memory\n"); 33 fprintf(stderr, "out of memory\n");
35 * and until C vendors implement C99's ways to control FP exceptions, 38 * and until C vendors implement C99's ways to control FP exceptions,
36 * Python requires non-stop mode. Alas, some platforms enable FP 39 * Python requires non-stop mode. Alas, some platforms enable FP
37 * exceptions by default. Here we disable them. 40 * exceptions by default. Here we disable them.
38 */ 41 */
39 #ifdef __FreeBSD__ 42 #ifdef __FreeBSD__
40 fp_except_t m;
41
42 m = fpgetmask(); 43 m = fpgetmask();
43 fpsetmask(m & ~FP_X_OFL); 44 fpsetmask(m & ~FP_X_OFL);
44 #endif 45 #endif
45 46
46 oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL)); 47 oldloc = _PyMem_RawStrdup(setlocale(LC_ALL, NULL));