Skip to content

Commit

Permalink
update src
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagewang committed Aug 20, 2012
1 parent 3ee3b8c commit b5e7419
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion project/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

export LWPR_ENV_RELEASE=1
export LWPR_ENV_ARCH=32
export LWPR_ENV_ARCH=64

make clean all
9 changes: 7 additions & 2 deletions src/JWUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,15 @@ namespace JWUtil
envFull += "=";
envFull += value;

char* newEnv = (char *)malloc(envFull.length() + 1);
memset(newEnv, 0, envFull.length() + 1);
strcat(newEnv, envFull.c_str());

#ifdef WIN32
_putenv(envFull.c_str());
_putenv(newEnv);
#else
setenv(name, value, 1);
putenv(newEnv);
//setenv(name, value, 1);
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions src/JavaConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ bool JavaConfig::load()
}
}

// Class Path
// Class Path/jars
{
BOOST_AUTO(child, pt.get_child("java.classpaths"));
for(BOOST_AUTO(pos, child.begin());
pos != child.end();
++pos) {
std::string value = pos->second.data();
if(this->expandMacro(value)) {
this->classPathList.push_back(value);
this->classPathList.push_back(value);
} else {
return false;
}
Expand Down Expand Up @@ -147,7 +147,7 @@ void JavaConfig::printAll()
{
printf("classpaths:\n");
for(size_t i = 0; i < this->classPathList.size(); i++) {
printf("\t %2d = [%s]\n", i, this->classPathList[i].c_str());
printf("\t %2d = [%s]\n", (int)i, this->classPathList[i].c_str());
}
}
{
Expand Down
12 changes: 6 additions & 6 deletions src/JavaLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ int JavaLauncher::launchJavaApp(int argc, char** argv)
JavaConfig::getInstance()->printLog("Find Main class OK.");

// 6, 创建包含Main方法的类
jobject mainObject = jniEnv->AllocObject(mainClass);
if(0 == mainClass) {
reportErrorMessage(jniEnv, "Create main class Failed.");
javaVM->DestroyJavaVM();
return -1;
}
//jobject mainObject = jniEnv->AllocObject(mainClass);
//if(0 == mainClass) {
// reportErrorMessage(jniEnv, "Create main class Failed.");
// javaVM->DestroyJavaVM();
// return -1;
//}

JavaConfig::getInstance()->printLog("Create Main class OK.");

Expand Down

0 comments on commit b5e7419

Please sign in to comment.