Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Upgrade libuv to ea4271f
Required adding uv_default_loop() in many places.
  • Loading branch information
ry committed Aug 31, 2011
1 parent 6f60683 commit 21cc4c4
Show file tree
Hide file tree
Showing 146 changed files with 2,152 additions and 1,688 deletions.
2 changes: 1 addition & 1 deletion deps/uv/Makefile
Expand Up @@ -24,7 +24,7 @@ ifdef MSVC
uname_S := MINGW
endif

CPPFLAGS += -Iinclude
CPPFLAGS += -Iinclude -Iinclude/uv-private

CARES_OBJS =
CARES_OBJS += src/ares/ares__close_sockets.o
Expand Down
50 changes: 26 additions & 24 deletions deps/uv/config-unix.mk
Expand Up @@ -23,7 +23,7 @@ AR = $(PREFIX)ar
E=
CSTDFLAG=--std=c89 -pedantic -Wall -Wextra -Wno-unused-parameter
CFLAGS=-g
CPPFLAGS += -Isrc/ev
CPPFLAGS += -Isrc/unix/ev
LINKFLAGS=-lm

CPPFLAGS += -D_LARGEFILE_SOURCE
Expand All @@ -34,15 +34,15 @@ EV_CONFIG=config_sunos.h
EIO_CONFIG=config_sunos.h
CPPFLAGS += -Isrc/ares/config_sunos -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
LINKFLAGS+=-lsocket -lnsl
UV_OS_FILE=uv-sunos.c
UV_OS_FILE=sunos.c
endif

ifeq (Darwin,$(uname_S))
EV_CONFIG=config_darwin.h
EIO_CONFIG=config_darwin.h
CPPFLAGS += -Isrc/ares/config_darwin
LINKFLAGS+=-framework CoreServices
UV_OS_FILE=uv-darwin.c
UV_OS_FILE=darwin.c
endif

ifeq (Linux,$(uname_S))
Expand All @@ -51,15 +51,15 @@ EIO_CONFIG=config_linux.h
CSTDFLAG += -D_XOPEN_SOURCE=600
CPPFLAGS += -Isrc/ares/config_linux
LINKFLAGS+=-lrt
UV_OS_FILE=uv-linux.c
UV_OS_FILE=linux.c
endif

ifeq (FreeBSD,$(uname_S))
EV_CONFIG=config_freebsd.h
EIO_CONFIG=config_freebsd.h
CPPFLAGS += -Isrc/ares/config_freebsd
LINKFLAGS+=
UV_OS_FILE=uv-freebsd.c
UV_OS_FILE=freebsd.c
endif

ifneq (,$(findstring CYGWIN,$(uname_S)))
Expand All @@ -69,7 +69,7 @@ EIO_CONFIG=config_cygwin.h
CSTDFLAG = -D_GNU_SOURCE
CPPFLAGS += -Isrc/ares/config_cygwin
LINKFLAGS+=
UV_OS_FILE=uv-cygwin.c
UV_OS_FILE=cygwin.c
endif

# Need _GNU_SOURCE for strdup?
Expand All @@ -85,46 +85,48 @@ endif
RUNNER_LIBS=
RUNNER_SRC=test/runner-unix.c

uv.a: src/uv-unix.o src/unix/fs.o src/uv-common.o src/uv-platform.o src/ev/ev.o src/uv-eio.o src/eio/eio.o $(CARES_OBJS)
$(AR) rcs uv.a src/uv-unix.o src/unix/fs.o src/uv-platform.o src/uv-common.o src/uv-eio.o src/ev/ev.o \
src/eio/eio.o $(CARES_OBJS)
uv.a: src/uv-unix.o src/unix/fs.o src/uv-common.o src/uv-platform.o src/unix/ev/ev.o src/unix/uv-eio.o src/unix/eio/eio.o $(CARES_OBJS)
$(AR) rcs uv.a src/uv-unix.o src/unix/fs.o src/uv-platform.o src/uv-common.o src/unix/uv-eio.o src/unix/ev/ev.o \
src/unix/eio/eio.o $(CARES_OBJS)

src/uv-platform.o: src/$(UV_OS_FILE) include/uv.h include/uv-unix.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/$(UV_OS_FILE) -o src/uv-platform.o
src/uv-platform.o: src/unix/$(UV_OS_FILE) include/uv.h include/uv-private/uv-unix.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/unix/$(UV_OS_FILE) -o src/uv-platform.o

src/uv-unix.o: src/uv-unix.c include/uv.h include/uv-unix.h src/unix/internal.h
src/uv-unix.o: src/uv-unix.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) -Isrc $(CFLAGS) -c src/uv-unix.c -o src/uv-unix.o

src/unix/fs.o: src/unix/fs.c include/uv.h include/uv-unix.h src/unix/internal.h
src/unix/fs.o: src/unix/fs.c include/uv.h include/uv-private/uv-unix.h src/unix/internal.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) -Isrc/ $(CFLAGS) -c src/unix/fs.c -o src/unix/fs.o

src/uv-common.o: src/uv-common.c include/uv.h include/uv-unix.h
src/uv-common.o: src/uv-common.c include/uv.h include/uv-private/uv-unix.h
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c src/uv-common.c -o src/uv-common.o

src/ev/ev.o: src/ev/ev.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/ev/ev.c -o src/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"
src/unix/ev/ev.o: src/unix/ev/ev.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c src/unix/ev/ev.c -o src/unix/ev/ev.o -DEV_CONFIG_H=\"$(EV_CONFIG)\"


EIO_CPPFLAGS += $(CPPFLAGS)
EIO_CPPFLAGS += -DEIO_CONFIG_H=\"$(EIO_CONFIG)\"
EIO_CPPFLAGS += -DEIO_STACKSIZE=262144
EIO_CPPFLAGS += -D_GNU_SOURCE

src/eio/eio.o: src/eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/eio/eio.c -o src/eio/eio.o
src/unix/eio/eio.o: src/unix/eio/eio.c
$(CC) $(EIO_CPPFLAGS) $(CFLAGS) -c src/unix/eio/eio.c -o src/unix/eio/eio.o

src/uv-eio.o: src/uv-eio.c
$(CC) $(CPPFLAGS) -Isrc/eio/ $(CSTDFLAG) $(CFLAGS) -c src/uv-eio.c -o src/uv-eio.o
src/unix/uv-eio.o: src/unix/uv-eio.c
$(CC) $(CPPFLAGS) -Isrc/unix/eio/ $(CSTDFLAG) $(CFLAGS) -c src/unix/uv-eio.c -o src/unix/uv-eio.o


clean-platform:
-rm -f src/ares/*.o
-rm -f src/ev/*.o
-rm -f src/eio/*.o
-rm -f src/unix/ev/*.o
-rm -f src/unix/eio/*.o
-rm -f src/unix/*.o
-rm -rf test/run-tests.dSYM run-benchmarks.dSYM

distclean-platform:
-rm -f src/ares/*.o
-rm -f src/ev/*.o
-rm -f src/eio/*.o
-rm -f src/unix/ev/*.o
-rm -f src/unix/*.o
-rm -f src/unix/eio/*.o
-rm -rf test/run-tests.dSYM run-benchmarks.dSYM
4 changes: 2 additions & 2 deletions deps/uv/include/eio.h → deps/uv/include/uv-private/eio.h
Expand Up @@ -195,15 +195,15 @@ enum
enum
{
EIO_MCL_CURRENT = 1,
EIO_MCL_FUTURE = 2,
EIO_MCL_FUTURE = 2
};

/* request priorities */

enum {
EIO_PRI_MIN = -4,
EIO_PRI_MAX = 4,
EIO_PRI_DEFAULT = 0,
EIO_PRI_DEFAULT = 0
};

/* eio request structure */
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions deps/uv/include/uv-unix.h → deps/uv/include/uv-private/uv-unix.h
Expand Up @@ -42,6 +42,16 @@ typedef struct {

typedef int uv_file;

#define UV_LOOP_PRIVATE_FIELDS \
ares_channel channel; \
/* \
* While the channel is active this timer is called once per second to be \
* sure that we're always calling ares_process. See the warning above the \
* definition of ares_timeout(). \
*/ \
ev_timer timer; \
struct ev_loop* ev;

#define UV_REQ_BUFSML_SIZE (4)

#define UV_REQ_PRIVATE_FIELDS /* empty */
Expand Down
40 changes: 38 additions & 2 deletions deps/uv/include/uv-win.h → deps/uv/include/uv-private/uv-win.h
Expand Up @@ -44,6 +44,40 @@ typedef struct uv_buf_t {

typedef int uv_file;

RB_HEAD(uv_timer_tree_s, uv_timer_s);

#define UV_LOOP_PRIVATE_FIELDS \
/* The loop's I/O completion port */ \
HANDLE iocp; \
/* Reference count that keeps the event loop alive */ \
int refs; \
/* The current time according to the event loop. in msecs. */ \
int64_t time; \
/* Tail of a single-linked circular queue of pending reqs. If the queue */ \
/* is empty, tail_ is NULL. If there is only one item, */ \
/* tail_->next_req == tail_ */ \
uv_req_t* pending_reqs_tail; \
/* Head of a single-linked list of closed handles */ \
uv_handle_t* endgame_handles; \
/* The head of the timers tree */ \
struct uv_timer_tree_s timers; \
/* Lists of active loop (prepare / check / idle) watchers */ \
uv_prepare_t* prepare_handles; \
uv_check_t* check_handles; \
uv_idle_t* idle_handles; \
/* This pointer will refer to the prepare/check/idle handle whose */ \
/* callback is scheduled to be called next. This is needed to allow */ \
/* safe removal from one of the lists above while that list being */ \
/* iterated over. */ \
uv_prepare_t* next_prepare_handle; \
uv_check_t* next_check_handle; \
uv_idle_t* next_idle_handle; \
ares_channel ares_channel; \
int ares_active_sockets; \
uv_timer_t ares_polling_timer; \
/* Last error code */ \
uv_err_t last_error;

#define UV_REQ_TYPE_PRIVATE \
/* TODO: remove the req suffix */ \
UV_ARES_EVENT_REQ, \
Expand Down Expand Up @@ -227,5 +261,7 @@ typedef int uv_file;

#define UV_WORK_PRIVATE_FIELDS \

int uv_utf16_to_utf8(const wchar_t* utf16Buffer, size_t utf16Size, char* utf8Buffer, size_t utf8Size);
int uv_utf8_to_utf16(const char* utf8Buffer, wchar_t* utf16Buffer, size_t utf16Size);
int uv_utf16_to_utf8(const wchar_t* utf16Buffer, size_t utf16Size,
char* utf8Buffer, size_t utf8Size);
int uv_utf8_to_utf16(const char* utf8Buffer, wchar_t* utf16Buffer,
size_t utf16Size);

0 comments on commit 21cc4c4

Please sign in to comment.