You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Chris Nauroth (JIRA)" <ji...@apache.org> on 2015/05/02 22:33:05 UTC

[jira] [Updated] (ZOOKEEPER-2178) Native client fails compilation on Windows.

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-2178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Nauroth updated ZOOKEEPER-2178:
-------------------------------------
    Attachment: ZOOKEEPER-2178.001.patch

I spotted the problem while reviewing Jenkins builds:

https://builds.apache.org/view/All/job/ZooKeeper-trunk-WinVS2008/1783/

I'm attaching a patch.  Testing through the native CLI looks good so far.

This corrects the mismatched method signature, removes the include of unistd.h, and implements calls to {{QueryPerformanceCounter}} for Windows.  We still include unistd.h on non-Windows, because there was an existing include of unistd.h guarded by an {{#ifndef _WIN32}}.

Here is the relevant API documentation for the Windows functions called by the patch:

https://msdn.microsoft.com/en-us/library/ms644905(v=vs.85).aspx

https://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx

https://msdn.microsoft.com/en-us/library/dn553408(v=vs.85).aspx#examples_for_acquiring_time_stamps


> Native client fails compilation on Windows.
> -------------------------------------------
>
>                 Key: ZOOKEEPER-2178
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2178
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: c client
>    Affects Versions: 3.5.0
>         Environment: Windows
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: ZOOKEEPER-2178.001.patch
>
>
> Due to several recent changes, the native client fails to compile on Windows:
> # ZOOKEEPER-827 (read-only mode) mismatched a function return type between the declaration and definition.
> # ZOOKEEPER-1626 (monotonic clock for tolerance to time adjustments) added an include of unistd.h, which does not exist on Windows.
> # Additionally, ZOOKEEPER-1626 did not implement a code path for accessing the Windows monotonic clock.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)