[pypy-commit] pypy default: more RPY_EXPORTED_FOR_TESTS => RPY_EXTERN

arigo noreply at buildbot.pypy.org
Sun Nov 9 17:47:22 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r74416:ac5c44882bb1
Date: 2014-11-09 13:44 +0100
http://bitbucket.org/pypy/pypy/changeset/ac5c44882bb1/

Log:	more RPY_EXPORTED_FOR_TESTS => RPY_EXTERN

diff --git a/pypy/module/_multibytecodec/src/cjkcodecs/multibytecodec.h b/pypy/module/_multibytecodec/src/cjkcodecs/multibytecodec.h
--- a/pypy/module/_multibytecodec/src/cjkcodecs/multibytecodec.h
+++ b/pypy/module/_multibytecodec/src/cjkcodecs/multibytecodec.h
@@ -97,24 +97,24 @@
   Py_UNICODE *outbuf_start, *outbuf, *outbuf_end;
 };
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 struct pypy_cjk_dec_s *pypy_cjk_dec_new(const MultibyteCodec *codec);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_dec_init(struct pypy_cjk_dec_s *d,
                              char *inbuf, Py_ssize_t inlen);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 void pypy_cjk_dec_free(struct pypy_cjk_dec_s *);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_dec_chunk(struct pypy_cjk_dec_s *);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_UNICODE *pypy_cjk_dec_outbuf(struct pypy_cjk_dec_s *);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_dec_outlen(struct pypy_cjk_dec_s *);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_dec_inbuf_remaining(struct pypy_cjk_dec_s *d);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_dec_inbuf_consumed(struct pypy_cjk_dec_s* d);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_dec_replace_on_error(struct pypy_cjk_dec_s* d,
                                          Py_UNICODE *, Py_ssize_t, Py_ssize_t);
 
@@ -125,35 +125,35 @@
   unsigned char *outbuf_start, *outbuf, *outbuf_end;
 };
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 struct pypy_cjk_enc_s *pypy_cjk_enc_new(const MultibyteCodec *codec);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_enc_init(struct pypy_cjk_enc_s *d,
                              Py_UNICODE *inbuf, Py_ssize_t inlen);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 void pypy_cjk_enc_free(struct pypy_cjk_enc_s *);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_enc_chunk(struct pypy_cjk_enc_s *, Py_ssize_t);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_enc_reset(struct pypy_cjk_enc_s *);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char *pypy_cjk_enc_outbuf(struct pypy_cjk_enc_s *);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_enc_outlen(struct pypy_cjk_enc_s *);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_enc_inbuf_remaining(struct pypy_cjk_enc_s *d);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_enc_inbuf_consumed(struct pypy_cjk_enc_s* d);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 Py_ssize_t pypy_cjk_enc_replace_on_error(struct pypy_cjk_enc_s* d,
                                          char *, Py_ssize_t, Py_ssize_t);
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 const MultibyteCodec *pypy_cjk_enc_getcodec(struct pypy_cjk_enc_s *);
 
 /* list of codecs defined in the .c files */
 
 #define DEFINE_CODEC(name)                              \
-    RPY_EXPORTED_FOR_TESTS MultibyteCodec *pypy_cjkcodec_##name(void);
+    RPY_EXTERN MultibyteCodec *pypy_cjkcodec_##name(void);
 
 // _codecs_cn
 DEFINE_CODEC(gb2312)
diff --git a/pypy/module/_ssl/thread_lock.py b/pypy/module/_ssl/thread_lock.py
--- a/pypy/module/_ssl/thread_lock.py
+++ b/pypy/module/_ssl/thread_lock.py
@@ -65,7 +65,7 @@
 eci = rthread.eci.merge(ExternalCompilationInfo(
     separate_module_sources=[separate_module_source],
     post_include_bits=[
-        "RPY_EXPORTED_FOR_TESTS int _PyPy_SSL_SetupThreads(void);"],
+        "RPY_EXTERN int _PyPy_SSL_SetupThreads(void);"],
     libraries = libraries,
 ))
 
diff --git a/pypy/module/cppyy/src/dummy_backend.cxx b/pypy/module/cppyy/src/dummy_backend.cxx
--- a/pypy/module/cppyy/src/dummy_backend.cxx
+++ b/pypy/module/cppyy/src/dummy_backend.cxx
@@ -349,29 +349,29 @@
 
 
 /* name to opaque C++ scope representation -------------------------------- */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_num_scopes(cppyy_scope_t handle) {
     return 0;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_resolve_name(const char* cppitem_name) {
     return cppstring_to_cstring(cppitem_name);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 cppyy_scope_t cppyy_get_scope(const char* scope_name) {
     return s_handles[scope_name];  // lookup failure will return 0 (== error)
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 cppyy_type_t cppyy_actual_class(cppyy_type_t klass, cppyy_object_t /* obj */) {
     return klass;
 }
 
 
 /* memory management ------------------------------------------------------ */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 void cppyy_destruct(cppyy_type_t handle, cppyy_object_t self) {
     if (handle == s_handles["example01"])
        delete (dummy::example01*)self;
@@ -379,7 +379,7 @@
 
 
 /* method/function dispatching -------------------------------------------- */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 void cppyy_call_v(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     long idx = (long)method;
     if (idx == s_methods["static_example01::staticSetPayload_payload*_double"]) {
@@ -469,7 +469,7 @@
     }
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 unsigned char cppyy_call_b(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     unsigned char result = 0;
     const long idx = (long)method;
@@ -482,7 +482,7 @@
     return result;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char cppyy_call_c(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     char result = 0;
     const long idx = (long)method;
@@ -498,7 +498,7 @@
     return result;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 short cppyy_call_h(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     short result = 0;
     const long idx = (long)method; 
@@ -514,7 +514,7 @@
     return result;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_call_i(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     int result = 0;
     const long idx = (long)method;
@@ -547,7 +547,7 @@
     return result;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 long cppyy_call_l(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     long result = 0;
     const long idx = (long)method;
@@ -689,7 +689,7 @@
     return result;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 long long cppyy_call_ll(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     long long result = 0;
     const long idx = (long)method;
@@ -705,7 +705,7 @@
     return result;
 }   
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 float cppyy_call_f(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     float result = 0;
     const long idx = (long)method;
@@ -718,7 +718,7 @@
     return result;
 }   
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 double cppyy_call_d(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     double result = 0.;
     const long idx = (long)method;
@@ -740,7 +740,7 @@
     return result;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_call_s(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     char* result = 0;
     const long idx = (long)method;
@@ -753,7 +753,7 @@
     return result;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 cppyy_object_t cppyy_constructor(cppyy_method_t method, cppyy_type_t handle, int nargs, void* args) {
     void* result = 0;
     const long idx = (long)method;
@@ -776,14 +776,14 @@
     return (cppyy_object_t)result;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 cppyy_methptrgetter_t cppyy_get_methptr_getter(cppyy_type_t /* handle */, cppyy_index_t /* method_index */) {
     return (cppyy_methptrgetter_t)0;
 }
 
 
 /* handling of function argument buffer ----------------------------------- */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 void* cppyy_allocate_function_args(int nargs) {
     CPPYY_G__value* args = (CPPYY_G__value*)malloc(nargs*sizeof(CPPYY_G__value));
     for (int i = 0; i < nargs; ++i)
@@ -793,36 +793,36 @@
 
 
 /* handling of function argument buffer ----------------------------------- */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 void cppyy_deallocate_function_args(void* args) {
     free(args);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 size_t cppyy_function_arg_sizeof() {
     return sizeof(CPPYY_G__value);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 size_t cppyy_function_arg_typeoffset() {
     return offsetof(CPPYY_G__value, type);
 }
 
 
 /* scope reflection information ------------------------------------------- */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_is_namespace(cppyy_scope_t /* handle */) {
     return 0;
 }   
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_is_enum(const char* /* type_name */) {
     return 0;
 }
     
     
 /* class reflection information ------------------------------------------- */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_final_name(cppyy_type_t handle) {
     for (Handles_t::iterator isp = s_handles.begin(); isp != s_handles.end(); ++isp) {
         if (isp->second == handle)
@@ -831,75 +831,75 @@
     return cppstring_to_cstring("<unknown>");
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_scoped_final_name(cppyy_type_t handle) {
     return cppyy_final_name(handle);
 }   
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_has_complex_hierarchy(cppyy_type_t /* handle */) {
     return 0;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_num_bases(cppyy_type_t /*handle*/) {
    return 0;
 }
 
 
 /* method/function reflection information --------------------------------- */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_num_methods(cppyy_scope_t handle) {
     return s_scopes[handle].m_methods.size();
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 cppyy_index_t cppyy_method_index_at(cppyy_scope_t /* scope */, int imeth) {
     return (cppyy_index_t)imeth;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_method_name(cppyy_scope_t handle, cppyy_index_t method_index) {
     return cppstring_to_cstring(s_scopes[handle].m_methods[(int)method_index].m_name);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_method_result_type(cppyy_scope_t handle, cppyy_index_t method_index) {
     return cppstring_to_cstring(s_scopes[handle].m_methods[method_index].m_returntype);
 }
     
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_method_num_args(cppyy_scope_t handle, cppyy_index_t method_index) {
     return s_scopes[handle].m_methods[method_index].m_argtypes.size();
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_method_req_args(cppyy_scope_t handle, cppyy_index_t method_index) {
     return cppyy_method_num_args(handle, method_index);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_method_arg_type(cppyy_scope_t handle, cppyy_index_t method_index, int arg_index) {
     return cppstring_to_cstring(s_scopes[handle].m_methods[method_index].m_argtypes[arg_index]);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_method_arg_default(
         cppyy_scope_t /* handle */, cppyy_index_t /* method_index */, int /* arg_index */) {
     return cppstring_to_cstring("");
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_method_signature(cppyy_scope_t /* handle */, cppyy_index_t /* method_index */) {
     return cppstring_to_cstring("");
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_method_is_template(cppyy_scope_t /* handle */, cppyy_index_t /* method_index */) {
     return 0;
 }
     
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 cppyy_method_t cppyy_get_method(cppyy_scope_t handle, cppyy_index_t method_index) {
     if (s_scopes.find(handle) != s_scopes.end()) {
         long id = s_scopes[handle].m_method_offset + (long)method_index;
@@ -911,7 +911,7 @@
 
 
 /* method properties -----------------------------------------------------  */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_is_constructor(cppyy_type_t handle, cppyy_index_t method_index) {
     if (s_scopes.find(handle) != s_scopes.end())
         return s_scopes[handle].m_methods[method_index].m_type == kConstructor;
@@ -919,7 +919,7 @@
     return 0;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_is_staticmethod(cppyy_type_t handle, cppyy_index_t method_index) {
     if (s_scopes.find(handle) != s_scopes.end())
         return s_scopes[handle].m_methods[method_index].m_type == kStatic;
@@ -929,34 +929,34 @@
 
 
 /* data member reflection information ------------------------------------- */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_num_datamembers(cppyy_scope_t handle) {
     return s_scopes[handle].m_datambrs.size();
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_datamember_name(cppyy_scope_t handle, int idatambr) {
     return cppstring_to_cstring(s_scopes[handle].m_datambrs[idatambr].m_name);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 char* cppyy_datamember_type(cppyy_scope_t handle, int idatambr) {
     return cppstring_to_cstring(s_scopes[handle].m_datambrs[idatambr].m_type);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 ptrdiff_t cppyy_datamember_offset(cppyy_scope_t handle, int idatambr) {
     return s_scopes[handle].m_datambrs[idatambr].m_offset;
 }
 
 
 /* data member properties ------------------------------------------------  */
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_is_publicdata(cppyy_scope_t handle, int idatambr) {
     return 1;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 int cppyy_is_staticdata(cppyy_scope_t handle, int idatambr) {
     return s_scopes[handle].m_datambrs[idatambr].m_isstatic;
 }
@@ -964,44 +964,44 @@
 
 /* misc helpers ----------------------------------------------------------- */
 #if defined(_MSC_VER)
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 long long cppyy_strtoll(const char* str) {
     return _strtoi64(str, NULL, 0);
 }
 
 extern "C" {
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 unsigned long long cppyy_strtoull(const char* str) {
     return _strtoui64(str, NULL, 0);
 }
 }
 #else
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 long long cppyy_strtoll(const char* str) {
     return strtoll(str, NULL, 0);
 }
 
 extern "C" {
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 unsigned long long cppyy_strtoull(const char* str) {
     return strtoull(str, NULL, 0);
 }
 }
 #endif
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 void cppyy_free(void* ptr) {
     free(ptr);
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 cppyy_object_t cppyy_charp2stdstring(const char* str) {
     void* arena = new char[sizeof(std::string)];
     new (arena) std::string(str);
     return (cppyy_object_t)arena;
 }
 
-RPY_EXPORTED_FOR_TESTS
+RPY_EXTERN
 cppyy_object_t cppyy_stdstring2stdstring(cppyy_object_t ptr) {
     void* arena = new char[sizeof(std::string)];
     new (arena) std::string(*(std::string*)ptr);
diff --git a/pypy/module/cppyy/test/conftest.py b/pypy/module/cppyy/test/conftest.py
--- a/pypy/module/cppyy/test/conftest.py
+++ b/pypy/module/cppyy/test/conftest.py
@@ -50,7 +50,7 @@
             eci = ExternalCompilationInfo(
                 separate_module_files=[srcpath.join('dummy_backend.cxx')],
                 include_dirs=[incpath, tstpath, cdir],
-                compile_extra=['-DRPY_EXPORTED_FOR_TESTS=RPY_EXPORTED'],
+                compile_extra=['-DRPY_EXTERN=RPY_EXPORTED'],
                 use_cpp_linker=True,
             )
 
diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -775,8 +775,7 @@
     struct PyPyAPI {
     %(members)s
     } _pypyAPI;
-    RPY_EXPORTED_FOR_TESTS
-    struct PyPyAPI* pypyAPI = &_pypyAPI;
+    RPY_EXTERN struct PyPyAPI* pypyAPI = &_pypyAPI;
     """ % dict(members=structmembers)
 
     functions = generate_decls_and_callbacks(db, export_symbols)
@@ -947,7 +946,7 @@
         name_no_star = process_va_name(name)
         header = ('%s pypy_va_get_%s(va_list* vp)' %
                   (name, name_no_star))
-        pypy_decls.append('RPY_EXPORTED_FOR_TESTS ' + header + ';')
+        pypy_decls.append('RPY_EXTERN ' + header + ';')
         functions.append(header + '\n{return va_arg(*vp, %s);}\n' % name)
 
     for name, (typ, expr) in GLOBALS.iteritems():
@@ -1007,7 +1006,7 @@
     if sys.platform == 'win32':
         get_pythonapi_source = '''
         #include <windows.h>
-        RPY_EXPORTED_FOR_TESTS
+        RPY_EXTERN
         HANDLE pypy_get_pythonapi_handle() {
             MEMORY_BASIC_INFORMATION  mi;
             memset(&mi, 0, sizeof(mi));
diff --git a/pypy/module/operator/tscmp.h b/pypy/module/operator/tscmp.h
--- a/pypy/module/operator/tscmp.h
+++ b/pypy/module/operator/tscmp.h
@@ -1,2 +1,2 @@
-RPY_EXPORTED_FOR_TESTS int pypy_tscmp(const char *, const char *, long, long);
-RPY_EXPORTED_FOR_TESTS int pypy_tscmp_wide(const wchar_t *, const wchar_t *, long, long);
+RPY_EXTERN int pypy_tscmp(const char *, const char *, long, long);
+RPY_EXTERN int pypy_tscmp_wide(const wchar_t *, const wchar_t *, long, long);
diff --git a/pypy/module/rctime/interp_time.py b/pypy/module/rctime/interp_time.py
--- a/pypy/module/rctime/interp_time.py
+++ b/pypy/module/rctime/interp_time.py
@@ -35,7 +35,7 @@
     eci = ExternalCompilationInfo(
         includes = ['windows.h'],
         post_include_bits = [
-            "RPY_EXPORTED_FOR_TESTS\n"
+            "RPY_EXTERN\n"
             "BOOL pypy_timemodule_setCtrlHandler(HANDLE event);"],
         separate_module_sources=['''
             static HANDLE interrupt_event;
@@ -178,13 +178,13 @@
 if _WIN:
     win_eci = ExternalCompilationInfo(
         includes = ["time.h"],
-        post_include_bits = ["RPY_EXPORTED_FOR_TESTS "
+        post_include_bits = ["RPY_EXTERN "
                              "long pypy_get_timezone();\n"
-                             "RPY_EXPORTED_FOR_TESTS "
+                             "RPY_EXTERN "
                              "int pypy_get_daylight();\n"
-                             "RPY_EXPORTED_FOR_TESTS "
+                             "RPY_EXTERN "
                              "char** pypy_get_tzname();\n"
-                             "RPY_EXPORTED_FOR_TESTS "
+                             "RPY_EXTERN "
                              "void pypy__tzset();"],
         separate_module_sources = ["""
         long pypy_get_timezone() { return timezone; }


More information about the pypy-commit mailing list