diff --git a/lib/searpc-named-pipe-transport.c b/lib/searpc-named-pipe-transport.c index b3b0cd5..ccb85fc 100644 --- a/lib/searpc-named-pipe-transport.c +++ b/lib/searpc-named-pipe-transport.c @@ -43,8 +43,8 @@ static int request_from_json (const char *content, size_t len, char **service, c static void json_object_set_string_member (json_t *object, const char *key, const char *value); static const char * json_object_get_string_member (json_t *object, const char *key); -static ssize_t pipe_write_n(SearpcNamedPipe fd, const void *vptr, size_t n); -static ssize_t pipe_read_n(SearpcNamedPipe fd, void *vptr, size_t n); +static gssize pipe_write_n(SearpcNamedPipe fd, const void *vptr, size_t n); +static gssize pipe_read_n(SearpcNamedPipe fd, void *vptr, size_t n); typedef struct { SearpcNamedPipeClient* client; @@ -481,11 +481,11 @@ json_object_get_string_member (json_t *object, const char *key) #if !defined(WIN32) // Write "n" bytes to a descriptor. -ssize_t +gssize pipe_write_n(int fd, const void *vptr, size_t n) { size_t nleft; - ssize_t nwritten; + gssize nwritten; const char *ptr; ptr = vptr; @@ -506,11 +506,11 @@ pipe_write_n(int fd, const void *vptr, size_t n) } // Read "n" bytes from a descriptor. -ssize_t +gssize pipe_read_n(int fd, void *vptr, size_t n) { size_t nleft; - ssize_t nread; + gssize nread; char *ptr; ptr = vptr; @@ -532,7 +532,7 @@ pipe_read_n(int fd, void *vptr, size_t n) #else // !defined(WIN32) -ssize_t pipe_read_n (SearpcNamedPipe fd, void *vptr, size_t n) +gssize pipe_read_n (SearpcNamedPipe fd, void *vptr, size_t n) { DWORD bytes_read; BOOL success = ReadFile( @@ -553,7 +553,7 @@ ssize_t pipe_read_n (SearpcNamedPipe fd, void *vptr, size_t n) return n; } -ssize_t pipe_write_n(SearpcNamedPipe fd, const void *vptr, size_t n) +gssize pipe_write_n(SearpcNamedPipe fd, const void *vptr, size_t n) { DWORD bytes_written; BOOL success = WriteFile( diff --git a/lib/searpc-utils.c b/lib/searpc-utils.c index c7345e7..a00417d 100644 --- a/lib/searpc-utils.c +++ b/lib/searpc-utils.c @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/libsearpc.sln b/libsearpc.sln new file mode 100644 index 0000000..d277e98 --- /dev/null +++ b/libsearpc.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29215.179 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsearpc", "libsearpc.vcxproj", "{7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}.Debug|x64.ActiveCfg = Debug|x64 + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}.Debug|x64.Build.0 = Debug|x64 + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}.Debug|x86.ActiveCfg = Debug|Win32 + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}.Debug|x86.Build.0 = Debug|Win32 + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}.Release|x64.ActiveCfg = Release|x64 + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}.Release|x64.Build.0 = Release|x64 + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}.Release|x86.ActiveCfg = Release|Win32 + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {393C05AB-0CCA-4180-93EF-57D9CB079042} + EndGlobalSection +EndGlobal diff --git a/libsearpc.vcxproj b/libsearpc.vcxproj new file mode 100644 index 0000000..883a341 --- /dev/null +++ b/libsearpc.vcxproj @@ -0,0 +1,118 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {7E7BDAA2-D61E-466D-B138-CC2454CAB1D3} + Win32Proj + 10.0 + + + + DynamicLibrary + true + v142 + + + Application + false + v142 + + + Application + true + v142 + + + Application + false + v142 + + + + + + + + + + + + + + + + + + + + + true + + + true + + + + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + ProgramDatabase + Disabled + + + MachineX86 + true + Windows + + + + + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + Level3 + ProgramDatabase + + + MachineX86 + true + Windows + true + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file