Git Product home page Git Product logo

Comments (6)

fancycode avatar fancycode commented on May 24, 2024

Fixed in 888bd7f, thanks for reporting.

from python-libevent.

honglei avatar honglei commented on May 24, 2024

I still met the following error:

  1. in pybase.c the macro 'suseconds_t' is not defined, its long in win32 platform

  2. VC2008 compiler specefic errors in pyhttp.c

658d657
< struct evbuffer *buffer = NULL;
661,662c660,662
< }

< buffer = evbuffer_new();

    }

    struct evbuffer *buffer = evbuffer_new();

721d720
< struct evbuffer *buffer = NULL;
726c725

< buffer = evbuffer_new();

    struct evbuffer *buffer = evbuffer_new();
  1. setup.py for link errors.

59c59,61

< extra_link_args = [ ]

extra_link_args = [
os.path.join(LIBEVENT_ROOT, '.libs', 'libevent.a'),
]
63d64
< os.path.join(LIBEVENT_ROOT, '.libs', 'libevent.a'),
68,75d68
< elif os.name == 'nt':
< # enable thread support
< extra_link_args.extend([
< os.path.join(LIBEVENT_ROOT, 'libevent.lib'),
< ])
< libraries.append('ws2_32')
< libraries.append('Advapi32')
<
79,80c72
< extra_link_args=extra_link_args,#define_macros=[('_WIN32_WINNT', '0x0600')]

< ),

    extra_link_args=extra_link_args),

after fixed these problem. i have build and installed it!

from python-libevent.

fancycode avatar fancycode commented on May 24, 2024

Could you please provide a unified diff by executing "git diff" in your checkout?

from python-libevent.

honglei avatar honglei commented on May 24, 2024

I pasted in the attached file.

On Tue, Aug 30, 2011 at 7:17 PM, fancycode <
[email protected]>wrote:

Could you please provide a unified diff by executing "git diff" in your
checkout?

Reply to this email directly or view it on GitHub:
#1 (comment)

from python-libevent.

honglei avatar honglei commented on May 24, 2024
Author: unknown <hongleij@.(none)>  2011-08-31 09:04:36
Committer: unknown <hongleij@.(none)>  2011-08-31 09:04:36
Parent: 888bd7feaf73606dd4737c617db23ad45024a059 (added missing parameter when calling "evutil_socket_geterror" (GitHub #1))
Branch: master
Follows: v0.9.1
Precedes: 

    build and install under VC2008/Win7

----------------------------------- setup.py -----------------------------------
index 8c5ee69..b8b25e9 100644
@@ -56,16 +56,23 @@ library_dirs = [
 ]
 libraries = [
 ]
-extra_link_args = [
-    os.path.join(LIBEVENT_ROOT, '.libs', 'libevent.a'),
-]
+extra_link_args = [ ]
 if os.name == 'posix':
     # enable thread support
     extra_link_args.extend([
+        os.path.join(LIBEVENT_ROOT, '.libs', 'libevent.a'),
         os.path.join(LIBEVENT_ROOT, '.libs', 'libevent_pthreads.a'),
     ])
     libraries.append('rt')
     libraries.append('pthread')
+elif os.name == 'nt':
+    # enable thread support
+    extra_link_args.extend([
+        os.path.join(LIBEVENT_ROOT,  'libevent.lib'),
+    ])    
+    libraries.append('ws2_32')
+    libraries.append('Advapi32')
+    
 extens = [
     Extension('_libevent', c_files, libraries=libraries,
         include_dirs=include_dirs, library_dirs=library_dirs,

--------------------------------- src/pybase.c ---------------------------------
index 02a2eee..bf80724 100644
@@ -26,6 +26,10 @@

 #include "pybase.h"

+#ifdef WIN32
+  #define suseconds_t long
+#endif
+
 typedef struct _PyConfigObject {
     PyObject_HEAD
     struct event_config *config;

--------------------------------- src/pyhttp.c ---------------------------------
index 4b22e1e..90714e7 100644
@@ -655,11 +655,11 @@ pyhttp_request_send_reply(PyHttpRequestObject *self, PyObject *args)
         evhttp_send_reply(self->request, code, reason, ((PyBufferObject *) data)->buffer);
         Py_END_ALLOW_THREADS
     } else {
+       struct evbuffer *buffer = NULL;
         if (PyObject_AsReadBuffer(pydata, (const void **) &data, &length) != 0) {
             return NULL;
-        }
-        
-        struct evbuffer *buffer = evbuffer_new();
+        }      
+        buffer = evbuffer_new();
         if (buffer == NULL) {
             return PyErr_NoMemory();
         }
@@ -718,11 +718,12 @@ pyhttp_request_send_reply_chunk(PyHttpRequestObject *self, PyObject *args)
         evhttp_send_reply_chunk(self->request, ((PyBufferObject *) data)->buffer);
         Py_END_ALLOW_THREADS
     } else {
+       struct evbuffer *buffer = NULL;
         if (PyObject_AsReadBuffer(pydata, (const void **) &data, &length) != 0) {
             return NULL;
         }

-        struct evbuffer *buffer = evbuffer_new();
+        buffer = evbuffer_new();
         if (buffer == NULL) {
             return PyErr_NoMemory();
         }

from python-libevent.

fancycode avatar fancycode commented on May 24, 2024

Committed in eb0824f, thanks.

from python-libevent.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.