Merge remote branch 'origin/master' into ios

This commit is contained in:
Joel Dice 2011-09-16 20:46:03 -06:00
commit 178dd7af34
4 changed files with 35 additions and 13 deletions

View File

@ -342,15 +342,33 @@ Java_java_io_File_toAbsolutePath(JNIEnv* e UNUSED, jclass, jstring path)
extern "C" JNIEXPORT jlong JNICALL
Java_java_io_File_length(JNIEnv* e, jclass, jstring path)
{
string_t chars = getChars(e, path);
if (chars) {
STRUCT_STAT s;
int r = STAT(chars, &s);
#ifdef PLATFORM_WINDOWS
LARGE_INTEGER fileSize;
string_t chars = getChars(e, path);
HANDLE file = CreateFileW
(chars, FILE_READ_DATA, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
releaseChars(e, path, chars);
if (r == 0) {
return s.st_size;
if (file != INVALID_HANDLE_VALUE)
GetFileSizeEx(file, &fileSize);
else return 0;
CloseHandle(file);
return static_cast<jlong>(fileSize.QuadPart);
#else
string_t chars = getChars(e, path);
if (chars) {
STRUCT_STAT s;
int r = STAT(chars, &s);
releaseChars(e, path, chars);
if (r == 0) {
return s.st_size;
}
}
}
#endif
return 0;
}

View File

@ -985,11 +985,12 @@ ifeq ($(platform),windows)
< "$(openjdk-src)/windows/native/java/net/net_util_md.h" \
> $(build)/openjdk/net_util_md.h
sed \
-e 's/IpPrefix/hide_IpPrefix/' \
-e 's/IpSuffix/hide_IpSuffix/' \
-e 's/IpDad/hide_IpDad/' \
-e 's/ScopeLevel/hide_ScopeLevel/' \
-e 's/SCOPE_LEVEL/hide_SCOPE_LEVEL/' \
-e 's/\(^#include "net_util.h"\)/\1\n#if (defined _INC_NLDEF) || (defined _WS2DEF_)\n#define HIDE(x) hide_##x\n#else\n#define HIDE(x) x\n#define _WINSOCK2API_\n#endif/' \
-e 's/\(IpPrefix[a-zA-Z_]*\)/HIDE(\1)/' \
-e 's/\(IpSuffix[a-zA-Z_]*\)/HIDE(\1)/' \
-e 's/\(IpDad[a-zA-Z_]*\)/HIDE(\1)/' \
-e 's/\(ScopeLevel[a-zA-Z_]*\)/HIDE(\1)/' \
-e 's/\(SCOPE_LEVEL[a-zA-Z_]*\)/HIDE(\1)/' \
< "$(openjdk-src)/windows/native/java/net/NetworkInterface.h" \
> $(build)/openjdk/NetworkInterface.h
echo 'static int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP);' >> $(build)/openjdk/NetworkInterface.h

View File

@ -18,7 +18,7 @@ typedef unsigned char uint8_t;
#ifdef BOOT_JAVAHOME
#if (defined __MINGW32__) || (defined _MSC_VER)
#if (! defined __x86_64__) && ((defined __MINGW32__) || (defined _MSC_VER))
# define EXPORT __declspec(dllexport)
# define SYMBOL(x) binary_javahome_jar_##x
#else

View File

@ -10,6 +10,9 @@ public class Zip {
for (File file: directory.listFiles()) {
if (file.isFile()) {
if (file.getName().endsWith(".jar")) {
System.out.println
("found " + file.getAbsolutePath() + " length " + file.length());
return file.getAbsolutePath();
}
} else if (file.isDirectory()) {