Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Server sample fails to compile for Windows x64 #1574

Open
hmartinez82 opened this issue Mar 16, 2024 · 0 comments · May be fixed by #1575
Open

HTTP Server sample fails to compile for Windows x64 #1574

hmartinez82 opened this issue Mar 16, 2024 · 0 comments · May be fixed by #1575

Comments

@hmartinez82
Copy link

hmartinez82 commented Mar 16, 2024

evutil_socket_t is a long long on Windows.
The do_term function passed as a pointer then does not match the function pointer type declaration. in http-server.c

Expected

libevent builds

Actual

../libevent-2.1.12-stable/sample/http-server.c:559:9: error: incompatible function pointer types passing
      'void (int, short, void *)' to parameter of type 'event_callback_fn' (aka 'void (*)(long long, short, void *)')
      [-Wincompatible-function-pointer-types]
  559 |         term = evsignal_new(base, SIGINT, do_term, base);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libevent-2.1.12-stable/include/event2/event.h:983:44: note: expanded from macro 'evsignal_new'
  983 |         event_new((b), (x), EV_SIGNAL|EV_PERSIST, (cb), (arg))
      |                                                   ^~~~
../libevent-2.1.12-stable/include/event2/event.h:1090:87: note: passing argument to parameter here
 1090 | struct event *event_new(struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
      |                                                                                       ^
@hmartinez82 hmartinez82 changed the title HTTP Server sample fails to compile for Windows HTTP Server sample fails to compile for Windows x64 Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant