Windows: avoid "uv_" naming conflicts. #3225

This commit is contained in:
Seth Jackson 2015-08-24 20:09:27 -04:00 committed by Justin M. Keyes
parent 56fe0c956f
commit b9d17c6a8a
7 changed files with 41 additions and 41 deletions

View File

@ -84,7 +84,7 @@
#include "nvim/version.h" #include "nvim/version.h"
#include "nvim/window.h" #include "nvim/window.h"
#include "nvim/os/os.h" #include "nvim/os/os.h"
#include "nvim/event/uv_process.h" #include "nvim/event/libuv_process.h"
#include "nvim/event/pty_process.h" #include "nvim/event/pty_process.h"
#include "nvim/event/rstream.h" #include "nvim/event/rstream.h"
#include "nvim/event/wstream.h" #include "nvim/event/wstream.h"
@ -456,7 +456,7 @@ static dictitem_T vimvars_var; /* variable used for v: */
typedef struct { typedef struct {
union { union {
UvProcess uv; LibuvProcess uv;
PtyProcess pty; PtyProcess pty;
} proc; } proc;
Stream in, out, err; Stream in, out, err;
@ -21100,7 +21100,7 @@ static inline TerminalJobData *common_job_init(char **argv, ufunc_T *on_stdout,
if (pty) { if (pty) {
data->proc.pty = pty_process_init(&loop, data); data->proc.pty = pty_process_init(&loop, data);
} else { } else {
data->proc.uv = uv_process_init(&loop, data); data->proc.uv = libuv_process_init(&loop, data);
} }
Process *proc = (Process *)&data->proc; Process *proc = (Process *)&data->proc;
proc->argv = argv; proc->argv = argv;

View File

@ -6,14 +6,14 @@
#include "nvim/event/rstream.h" #include "nvim/event/rstream.h"
#include "nvim/event/wstream.h" #include "nvim/event/wstream.h"
#include "nvim/event/process.h" #include "nvim/event/process.h"
#include "nvim/event/uv_process.h" #include "nvim/event/libuv_process.h"
#include "nvim/log.h" #include "nvim/log.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS #ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/uv_process.c.generated.h" # include "event/libuv_process.c.generated.h"
#endif #endif
bool uv_process_spawn(UvProcess *uvproc) bool libuv_process_spawn(LibuvProcess *uvproc)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
{ {
Process *proc = (Process *)uvproc; Process *proc = (Process *)uvproc;
@ -55,7 +55,7 @@ bool uv_process_spawn(UvProcess *uvproc)
return true; return true;
} }
void uv_process_close(UvProcess *uvproc) void libuv_process_close(LibuvProcess *uvproc)
FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(1)
{ {
uv_close((uv_handle_t *)&uvproc->uv, close_cb); uv_close((uv_handle_t *)&uvproc->uv, close_cb);

View File

@ -0,0 +1,25 @@
#ifndef NVIM_EVENT_LIBUV_PROCESS_H
#define NVIM_EVENT_LIBUV_PROCESS_H
#include <uv.h>
#include "nvim/event/process.h"
typedef struct libuv_process {
Process process;
uv_process_t uv;
uv_process_options_t uvopts;
uv_stdio_container_t uvstdio[3];
} LibuvProcess;
static inline LibuvProcess libuv_process_init(Loop *loop, void *data)
{
LibuvProcess rv;
rv.process = process_init(loop, kProcessTypeUv, data);
return rv;
}
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/libuv_process.h.generated.h"
#endif
#endif // NVIM_EVENT_LIBUV_PROCESS_H

View File

@ -8,7 +8,7 @@
#include "nvim/event/rstream.h" #include "nvim/event/rstream.h"
#include "nvim/event/wstream.h" #include "nvim/event/wstream.h"
#include "nvim/event/process.h" #include "nvim/event/process.h"
#include "nvim/event/uv_process.h" #include "nvim/event/libuv_process.h"
#include "nvim/event/pty_process.h" #include "nvim/event/pty_process.h"
#include "nvim/globals.h" #include "nvim/globals.h"
#include "nvim/log.h" #include "nvim/log.h"
@ -47,7 +47,7 @@ bool process_spawn(Process *proc) FUNC_ATTR_NONNULL_ALL
bool success; bool success;
switch (proc->type) { switch (proc->type) {
case kProcessTypeUv: case kProcessTypeUv:
success = uv_process_spawn((UvProcess *)proc); success = libuv_process_spawn((LibuvProcess *)proc);
break; break;
case kProcessTypePty: case kProcessTypePty:
success = pty_process_spawn((PtyProcess *)proc); success = pty_process_spawn((PtyProcess *)proc);
@ -68,7 +68,7 @@ bool process_spawn(Process *proc) FUNC_ATTR_NONNULL_ALL
} }
if (proc->type == kProcessTypeUv) { if (proc->type == kProcessTypeUv) {
uv_close((uv_handle_t *)&(((UvProcess *)proc)->uv), NULL); uv_close((uv_handle_t *)&(((LibuvProcess *)proc)->uv), NULL);
} else { } else {
process_close(proc); process_close(proc);
} }
@ -307,7 +307,7 @@ static void process_close(Process *proc)
proc->closed = true; proc->closed = true;
switch (proc->type) { switch (proc->type) {
case kProcessTypeUv: case kProcessTypeUv:
uv_process_close((UvProcess *)proc); libuv_process_close((LibuvProcess *)proc);
break; break;
case kProcessTypePty: case kProcessTypePty:
pty_process_close((PtyProcess *)proc); pty_process_close((PtyProcess *)proc);

View File

@ -1,25 +0,0 @@
#ifndef NVIM_EVENT_UV_PROCESS_H
#define NVIM_EVENT_UV_PROCESS_H
#include <uv.h>
#include "nvim/event/process.h"
typedef struct uv_process {
Process process;
uv_process_t uv;
uv_process_options_t uvopts;
uv_stdio_container_t uvstdio[3];
} UvProcess;
static inline UvProcess uv_process_init(Loop *loop, void *data)
{
UvProcess rv;
rv.process = process_init(loop, kProcessTypeUv, data);
return rv;
}
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/uv_process.h.generated.h"
#endif
#endif // NVIM_EVENT_UV_PROCESS_H

View File

@ -10,7 +10,7 @@
#include "nvim/msgpack_rpc/channel.h" #include "nvim/msgpack_rpc/channel.h"
#include "nvim/msgpack_rpc/remote_ui.h" #include "nvim/msgpack_rpc/remote_ui.h"
#include "nvim/event/loop.h" #include "nvim/event/loop.h"
#include "nvim/event/uv_process.h" #include "nvim/event/libuv_process.h"
#include "nvim/event/rstream.h" #include "nvim/event/rstream.h"
#include "nvim/event/wstream.h" #include "nvim/event/wstream.h"
#include "nvim/event/socket.h" #include "nvim/event/socket.h"
@ -55,7 +55,7 @@ typedef struct {
union { union {
Stream stream; Stream stream;
struct { struct {
UvProcess uvproc; LibuvProcess uvproc;
Stream in; Stream in;
Stream out; Stream out;
Stream err; Stream err;
@ -119,7 +119,7 @@ void channel_teardown(void)
uint64_t channel_from_process(char **argv) uint64_t channel_from_process(char **argv)
{ {
Channel *channel = register_channel(kChannelTypeProc); Channel *channel = register_channel(kChannelTypeProc);
channel->data.process.uvproc = uv_process_init(&loop, channel); channel->data.process.uvproc = libuv_process_init(&loop, channel);
Process *proc = &channel->data.process.uvproc.process; Process *proc = &channel->data.process.uvproc.process;
proc->argv = argv; proc->argv = argv;
proc->in = &channel->data.process.in; proc->in = &channel->data.process.in;

View File

@ -9,7 +9,7 @@
#include "nvim/lib/kvec.h" #include "nvim/lib/kvec.h"
#include "nvim/log.h" #include "nvim/log.h"
#include "nvim/event/loop.h" #include "nvim/event/loop.h"
#include "nvim/event/uv_process.h" #include "nvim/event/libuv_process.h"
#include "nvim/event/rstream.h" #include "nvim/event/rstream.h"
#include "nvim/os/shell.h" #include "nvim/os/shell.h"
#include "nvim/os/signal.h" #include "nvim/os/signal.h"
@ -205,7 +205,7 @@ static int do_os_system(char **argv,
xstrlcpy(prog, argv[0], MAXPATHL); xstrlcpy(prog, argv[0], MAXPATHL);
Stream in, out, err; Stream in, out, err;
UvProcess uvproc = uv_process_init(&loop, &buf); LibuvProcess uvproc = libuv_process_init(&loop, &buf);
Process *proc = &uvproc.process; Process *proc = &uvproc.process;
Queue *events = queue_new_child(loop.events); Queue *events = queue_new_child(loop.events);
proc->events = events; proc->events = events;