diff options
author | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-28 22:17:44 +0000 |
---|---|---|
committer | darylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-03-28 22:17:44 +0000 |
commit | 521527e0b63910d6d4d0d011e86738f21fbd32bf (patch) | |
tree | 5e2c00b8c2cdc2973ca2f6b1228880638349892b /AppPkg/Applications/Python/Efi | |
parent | 4adc12bfc30e59c4592c0351e0d9d1a07ed0e357 (diff) | |
download | edk2-platforms-521527e0b63910d6d4d0d011e86738f21fbd32bf.tar.xz |
StdLib/Include/stdarg.h: Added the __va_copy macro for Python compatibility.
AppPkg/Applications/Python: Deleted obsolete and incomplete PyMod-2.7.1. Changes to enable compilation using GCC 4.4 on both Windows and Linux hosts.
Signed-off-by: daryl.mcdaniel@intel.com
Reviewed-by: jaben.carsey@intel.com
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13147 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'AppPkg/Applications/Python/Efi')
-rw-r--r-- | AppPkg/Applications/Python/Efi/edk2module.c | 69 | ||||
-rw-r--r-- | AppPkg/Applications/Python/Efi/getpath.c | 14 |
2 files changed, 49 insertions, 34 deletions
diff --git a/AppPkg/Applications/Python/Efi/edk2module.c b/AppPkg/Applications/Python/Efi/edk2module.c index edc9c867f1..037849504f 100644 --- a/AppPkg/Applications/Python/Efi/edk2module.c +++ b/AppPkg/Applications/Python/Efi/edk2module.c @@ -25,11 +25,11 @@ extern "C" {
#endif
-PyDoc_STRVAR(posix__doc__,
-"This module provides access to operating system functionality that is\n\
-standardized by the C Standard and the POSIX standard (a thinly\n\
-disguised Unix interface). Refer to the library manual and\n\
-corresponding Unix manual entries for more information on calls.");
+PyDoc_STRVAR(edk2__doc__,
+ "This module provides access to UEFI firmware functionality that is\n\
+ standardized by the C Standard and the POSIX standard (a thinly\n\
+ disguised Unix interface). Refer to the library manual and\n\
+ corresponding UEFI Specification entries for more information on calls.");
#ifndef Py_USING_UNICODE
/* This is used in signatures of functions. */
@@ -222,24 +222,26 @@ posix_error_with_allocated_filename(char* name) /* POSIX generic methods */
-static PyObject *
-posix_fildes(PyObject *fdobj, int (*func)(int))
-{
- int fd;
- int res;
- fd = PyObject_AsFileDescriptor(fdobj);
- if (fd < 0)
- return NULL;
- if (!_PyVerify_fd(fd))
- return posix_error();
- Py_BEGIN_ALLOW_THREADS
- res = (*func)(fd);
- Py_END_ALLOW_THREADS
- if (res < 0)
- return posix_error();
- Py_INCREF(Py_None);
- return Py_None;
-}
+#ifndef UEFI_C_SOURCE
+ static PyObject *
+ posix_fildes(PyObject *fdobj, int (*func)(int))
+ {
+ int fd;
+ int res;
+ fd = PyObject_AsFileDescriptor(fdobj);
+ if (fd < 0)
+ return NULL;
+ if (!_PyVerify_fd(fd))
+ return posix_error();
+ Py_BEGIN_ALLOW_THREADS
+ res = (*func)(fd);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return posix_error();
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+#endif /* UEFI_C_SOURCE */
static PyObject *
posix_1str(PyObject *args, char *format, int (*func)(const char*))
@@ -401,11 +403,12 @@ static PyStructSequence_Desc statvfs_result_desc = { statvfs_result_fields,
10
};
+
+static PyTypeObject StatVFSResultType;
#endif
static int initialized;
static PyTypeObject StatResultType;
-static PyTypeObject StatVFSResultType;
static newfunc structseq_new;
static PyObject *
@@ -437,7 +440,6 @@ statresult_new(PyTypeObject *type, PyObject *args, PyObject *kwds) static int _stat_float_times = 0;
#else
static int _stat_float_times = 1;
-#endif
PyDoc_STRVAR(stat_float_times__doc__,
"stat_float_times([newval]) -> oldval\n\n\
@@ -460,6 +462,7 @@ stat_float_times(PyObject* self, PyObject *args) Py_INCREF(Py_None);
return Py_None;
}
+#endif /* UEFI_C_SOURCE */
static void
fill_time(PyObject *v, int index, time_t sec, unsigned long nsec)
@@ -2539,6 +2542,7 @@ posix_getlogin(PyObject *self, PyObject *noargs) }
#endif
+#ifndef UEFI_C_SOURCE
PyDoc_STRVAR(posix_getuid__doc__,
"getuid() -> uid\n\n\
Return the current process's user id.");
@@ -2548,7 +2552,7 @@ posix_getuid(PyObject *self, PyObject *noargs) {
return PyInt_FromLong((long)getuid());
}
-
+#endif /* UEFI_C_SOURCE */
#ifdef HAVE_KILL
PyDoc_STRVAR(posix_kill__doc__,
@@ -5743,6 +5747,7 @@ struct constdef { long value;
};
+#ifndef UEFI_C_SOURCE
static int
conv_confname(PyObject *arg, int *valuep, struct constdef *table,
size_t tablesize)
@@ -5777,7 +5782,7 @@ conv_confname(PyObject *arg, int *valuep, struct constdef *table, "configuration names must be strings or integers");
return 0;
}
-
+#endif /* UEFI_C_SOURCE */
#if defined(HAVE_FPATHCONF) || defined(HAVE_PATHCONF)
static struct constdef posix_constants_pathconf[] = {
@@ -6629,6 +6634,7 @@ posix_sysconf(PyObject *self, PyObject *args) #endif
+#if defined(HAVE_FPATHCONF) || defined(HAVE_PATHCONF) || defined(HAVE_CONFSTR) || defined(HAVE_SYSCONF)
/* This code is used to ensure that the tables of configuration value names
* are in sorted order as required by conv_confname(), and also to build the
* the exported dictionaries that are used to publish information about the
@@ -6673,6 +6679,7 @@ setup_confname_table(struct constdef *table, size_t tablesize, }
return PyModule_AddObject(module, tablename, d);
}
+#endif /* HAVE_FPATHCONF || HAVE_PATHCONF || HAVE_CONFSTR || HAVE_SYSCONF */
/* Return -1 on failure, 0 on success. */
static int
@@ -7341,11 +7348,15 @@ all_ins(PyObject *d) PyMODINIT_FUNC
INITFUNC(void)
{
- PyObject *m, *v;
+ PyObject *m;
+
+#ifndef UEFI_C_SOURCE
+ PyObject *v;
+#endif
m = Py_InitModule3(MODNAME,
posix_methods,
- posix__doc__);
+ edk2__doc__);
if (m == NULL)
return;
diff --git a/AppPkg/Applications/Python/Efi/getpath.c b/AppPkg/Applications/Python/Efi/getpath.c index 5a8c520027..9492864379 100644 --- a/AppPkg/Applications/Python/Efi/getpath.c +++ b/AppPkg/Applications/Python/Efi/getpath.c @@ -21,7 +21,7 @@ /Efi/StdLib/lib/python.VERSION The platform independent Python modules.
/Efi/StdLib/lib/python.VERSION/dynalib Dynamically loadable Python extension modules.
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -65,10 +65,12 @@ #endif
#ifndef PYTHONPATH
-//#define PYTHONPATH PREFIX LIBPYTHON sDELIM \
-// EXEC_PREFIX LIBPYTHON "/lib-dynload"
- #define PYTHONPATH LIBPYTHON // sDELIM
-// LIBPYTHON "/lib-dynload"
+ #ifdef HAVE_ENVIRONMENT_OPS
+ #define PYTHONPATH PREFIX LIBPYTHON sDELIM \
+ EXEC_PREFIX LIBPYTHON "/lib-dynload"
+ #else
+ #define PYTHONPATH LIBPYTHON
+ #endif
#endif
#ifndef LANDMARK
@@ -115,6 +117,7 @@ reduce(char *dir) dir[i] = '\0';
}
+#ifndef UEFI_C_SOURCE
/** Does filename point to a file and not directory?
@param[in] filename The fully qualified path to the object to test.
@@ -183,6 +186,7 @@ isdir(char *filename) return 1;
}
+#endif /* UEFI_C_SOURCE */
/** Determine if a path is absolute, or not.
An absolute path consists of a volume name, "VOL:", followed by a rooted path,
|