[pypy-svn] r54947 - in pypy/branch/win32port/pypy: module/thread translator/c/src
afa at codespeak.net
afa at codespeak.net
Mon May 19 17:22:09 CEST 2008
Author: afa
Date: Mon May 19 17:22:07 2008
New Revision: 54947
Modified:
pypy/branch/win32port/pypy/module/thread/ll_thread.py
pypy/branch/win32port/pypy/translator/c/src/thread.h
Log:
Attempt to remove Python.h from pypy's thread.h.
Code seems simpler, but it needs some tests on Unix.
Modified: pypy/branch/win32port/pypy/module/thread/ll_thread.py
==============================================================================
--- pypy/branch/win32port/pypy/module/thread/ll_thread.py (original)
+++ pypy/branch/win32port/pypy/module/thread/ll_thread.py Mon May 19 17:22:07 2008
@@ -17,21 +17,9 @@
error = thread.error
-_MS_WINDOWS = os.name == "nt"
-
-if not _MS_WINDOWS:
- includes = ['unistd.h']
-else:
- includes = []
-
eci = ExternalCompilationInfo(
- includes = includes + ['src/thread.h'],
- separate_module_sources=[
- '''
- #include <Python.h>
- #include <src/exception.h>
- #include <src/thread.h>
- '''],
+ includes = ['src/thread.h'],
+ separate_module_sources = [''],
include_dirs = [str(py.path.local(autopath.pypydir).join('translator', 'c')),
python_inc],
export_symbols = ['RPyThreadGetIdent', 'RPyThreadLockInit',
Modified: pypy/branch/win32port/pypy/translator/c/src/thread.h
==============================================================================
--- pypy/branch/win32port/pypy/translator/c/src/thread.h (original)
+++ pypy/branch/win32port/pypy/translator/c/src/thread.h Mon May 19 17:22:07 2008
@@ -3,7 +3,13 @@
#ifndef __PYPY_THREAD_H
#define __PYPY_THREAD_H
-#include "Python.h"
+#include <assert.h>
+
+#ifdef _WIN32
+#include "thread_nt.h"
+#else
+
+#include <unistd.h>
#ifndef _POSIX_THREADS
/* This means pthreads are not implemented in libc headers, hence the macro
@@ -18,9 +24,7 @@
#include "thread_pthread.h"
#endif
-#ifdef NT_THREADS
-#include "thread_nt.h"
-#endif
+#endif /* !_WIN32 */
#ifdef USE___THREAD
More information about the Pypy-commit
mailing list