Q:

"Error: expected a declaration" in apache hadoop source code with Visual Studio 2010

I am installing Apache Hadoop on a single cluster, on my Laptop in fact. I have done all the installation according to the manual here, however, I have got errors while installing. A solution is to compile it manually using VS, and I have done that. But in building the code, I get error with the following line
#define WIDEN_STRING(x) WIDEN_STRING_(x)
#define WIDEN_STRING_(x) L ## x
#define STRINGIFY(x) STRINGIFY_(x)
#define STRINGIFY_(x) #x

#pragma message("WSCE config is " STRINGIFY(WSCE_CONFIG_DIR) "\\" STRINGIFY(WSCE_CONFIG_FILE))

const WCHAR* wsceConfigRelativePath = WIDEN_STRING(STRINGIFY(WSCE_CONFIG_DIR)) L"\\" WIDEN_STRING(STRINGIFY(WSCE_CONFIG_FILE));

in the file HADOOP_SRC_FOLDER\hadoop-common-project\hadoop-common\src\main\winutils\libwinutils.c.
However, my question is what's wrong with this line of code? Although it seems invalid according to the standard of C++. I am totally confused with this line of code.

A:

In Hadoop 2.6 this handled via the maven. These values are defined as properties in the hadoop-common-project/hadoop-common/pom.xml file as follows:
<properties>
<hadoop.component>common</hadoop.component>
<is.hadoop.component>true</is.hadoop.component>
<wsce.config.dir>../etc/hadoop</wsce.config.dir>
<wsce.config.file>wsce-site.xml</wsce.config.file>
</properties>

This later used in when calling msbuild <argument>/p:WsceConfigDir=${wsce.config.dir}</argument> <argument>/p:WsceConfigFile=${wsce.config.file}</argument>
The libwinutils.vxcproj, then defines WSCE_CONFIG_DIR and WSCE_CONFIG_FILE as follows:
 <PreprocessorDefinitions>WIN32;_DEBUG;_UNICODE;UNICODE;WSCE_CONFIG_DIR=$(WsceConfigDir);WSCE_CONFIG_FILE=$(WsceConfigFile);%(PreprocessorDefinitions)</PreprocessorDefinitions>

