Mercurial > hg > nginx
view src/event/ngx_event_posted.c @ 9314:32a5186a2705
Win32: improved MinGW/MinGW-w64 GCC checks.
Previously, __GNUC__ was checked, which is now replaced with __MINGW32__
checks. The difference is that __MINGW32__ is defined when using MinGW
(or MinGW-w64) header files regardless of the compiler being used. And,
more importantly, it is not defined when Clang is being used (which
pretends to be GCC by default) with Windows SDK header files.
With this change, it is now possible to compile nginx with native Clang
on Windows. This current requires --with-ld-opt="-lkernel32 -luser32"
though, since native Clang on Windows uses MSVC linker, which does
not link kernel32.lib and user32.lib automatically.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 07 Aug 2024 03:56:59 +0300 |
parents | f1720934c45b |
children |
line wrap: on
line source
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #include <ngx_config.h> #include <ngx_core.h> #include <ngx_event.h> ngx_queue_t ngx_posted_accept_events; ngx_queue_t ngx_posted_next_events; ngx_queue_t ngx_posted_events; void ngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted) { ngx_queue_t *q; ngx_event_t *ev; while (!ngx_queue_empty(posted)) { q = ngx_queue_head(posted); ev = ngx_queue_data(q, ngx_event_t, queue); ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "posted event %p", ev); ngx_delete_posted_event(ev); ev->handler(ev); } } void ngx_event_move_posted_next(ngx_cycle_t *cycle) { ngx_queue_t *q; ngx_event_t *ev; for (q = ngx_queue_head(&ngx_posted_next_events); q != ngx_queue_sentinel(&ngx_posted_next_events); q = ngx_queue_next(q)) { ev = ngx_queue_data(q, ngx_event_t, queue); ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "posted next event %p", ev); ev->ready = 1; ev->available = -1; } ngx_queue_add(&ngx_posted_events, &ngx_posted_next_events); ngx_queue_init(&ngx_posted_next_events); }