[ 
https://issues.apache.org/jira/browse/HDFS-7188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14232059#comment-14232059
 ] 

Colin Patrick McCabe commented on HDFS-7188:
--------------------------------------------

Hi Thanh,

Great work on this patch.  The CMakeLists.txt parts look good.

I think we should try to avoid having a lot of #ifdefs in files.  Rather than 
having #ifdef WINDOWS at the top of so many files, it would be nicer to have a 
{{platform.h}} that supplied the portability glue that we need.

For example, platform.h could have a function like "setPlatformEnvironment" 
(implementing in platform.cc) and this could do either _putenv_s or setenv, 
depending on whether the platform was windows.  It could also do {{#define 
strcasecmp _stricmp}} and perhaps include other Windows headers like 
IPHlpApi.h, ws2ipdef.h, and so forth.  Using _access instead of access on 
Windows is another example.  And defining PRId64 and the other standard macros 
that I guess VS2010 doesn't have yet.

There are other cases where we can just include a header unconditionally.  We 
don't need ifdefs like this:
{code}
21    #ifdef _WIN32
22      #include <cstdint>
23      #endif
{code}

We don't need the ifdefs here, we can just include this unconditionally and it 
will work fine on both Linux and Windows.

For UserInfo.cc, I don't see why we need to distinguish between real and 
effective users on Linux.  it seems like we can just take the effective user.  
My understanding is that "real user" comes into play mostly when you're 
attempting to change user ids, which we aren't doing.  Unless someone can think 
of a reason why we need to care about real user id in this library, I'd just 
take it out.

> support build libhdfs3 on windows
> ---------------------------------
>
>                 Key: HDFS-7188
>                 URL: https://issues.apache.org/jira/browse/HDFS-7188
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>         Environment: Windows System, Visual Studio 2010
>            Reporter: Zhanwei Wang
>            Assignee: Thanh Do
>         Attachments: HDFS-7188-branch-HDFS-6994-0.patch
>
>
> libhdfs3 should work on windows



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

Reply via email to