mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 183382 - Added JNICALL to the winreg native code to fix a crash that was happening on Vista with IBM's VM. Also moved this build to use MinGW instead of MSVC.
This commit is contained in:
parent
dd55dc2b58
commit
4be0fe893c
4 changed files with 15 additions and 29 deletions
|
@ -8,12 +8,13 @@ endif
|
||||||
OS = win32
|
OS = win32
|
||||||
ARCH = x86
|
ARCH = x86
|
||||||
|
|
||||||
JDK_INCLUDES= $(JAVA_HOME)/include
|
JDK_INCLUDES= "$(JAVA_HOME)/include"
|
||||||
JDK_OS_INCLUDES= $(JAVA_HOME)/include/$(OS)
|
JDK_OS_INCLUDES= "$(JAVA_HOME)/include/$(OS)"
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CPPFLAGS = -I. -I$(JDK_INCLUDES) -I$(JDK_OS_INCLUDES)
|
CFLAGS = -DUNICODE -I$(JDK_INCLUDES) -I$(JDK_OS_INCLUDES)
|
||||||
CFLAGS += -D_UNICODE -Dwchar_t=short
|
CXX=g++
|
||||||
|
CXXFLAGS=$(CFLAGS)
|
||||||
|
|
||||||
INSTALL_DIR = ../os/$(OS)/$(ARCH)
|
INSTALL_DIR = ../os/$(OS)/$(ARCH)
|
||||||
|
|
||||||
|
@ -21,15 +22,18 @@ LIB_NAME_SPAWNER = spawner.dll
|
||||||
LIB_NAME_FULL_SPAWNER = $(INSTALL_DIR)/spawner.dll
|
LIB_NAME_FULL_SPAWNER = $(INSTALL_DIR)/spawner.dll
|
||||||
OBJS_SPAWNER=StdAfx.o Win32ProcessEx.o iostream.o raise.o spawner.o
|
OBJS_SPAWNER=StdAfx.o Win32ProcessEx.o iostream.o raise.o spawner.o
|
||||||
|
|
||||||
OBJS = $(OBJS_SPAWNER)
|
WINREG = $(INSTALL_DIR)/winreg.dll
|
||||||
|
OBJS_WINREG = winreg.o
|
||||||
|
|
||||||
all: $(LIB_NAME_FULL_SPAWNER)
|
all: $(LIB_NAME_FULL_SPAWNER) $(WINREG)
|
||||||
|
|
||||||
rebuild: clean all
|
rebuild: clean all
|
||||||
|
|
||||||
$(LIB_NAME_FULL_SPAWNER) : $(OBJS_SPAWNER)
|
$(LIB_NAME_FULL_SPAWNER) : $(OBJS_SPAWNER)
|
||||||
mkdir -p $(INSTALL_DIR)
|
$(CC) -Wl,--kill-at -shared -o $(LIB_NAME_FULL_SPAWNER) $(OBJS_SPAWNER)
|
||||||
$(CC) -Wl,--kill-at -g -shared -o $(LIB_NAME_FULL_SPAWNER) $(OBJS_SPAWNER)
|
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
$(RM) $(OBJS_SPAWNER) $(LIB_NAME_FULL_SPAWNER)
|
$(RM) $(OBJS_SPAWNER) $(LIB_NAME_FULL_SPAWNER) $(OBJS_WINREG) $(WINREG)
|
||||||
|
|
||||||
|
$(WINREG) : $(OBJS_WINREG)
|
||||||
|
$(CXX) -Wl,--kill-at -shared -o $(WINREG) $(OBJS_WINREG)
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
#*******************************************************************************
|
|
||||||
# Copyright (c) 2005, 2006 QNX Software Systems
|
|
||||||
# All rights reserved. This program and the accompanying materials
|
|
||||||
# are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
# which accompanies this distribution, and is available at
|
|
||||||
# http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
#
|
|
||||||
# Contributors:
|
|
||||||
# QNX Software Systems - initial API and implementation
|
|
||||||
#*******************************************************************************
|
|
||||||
TARGET = ..\os\win32\x86\winreg.dll
|
|
||||||
|
|
||||||
OBJS = winreg.obj
|
|
||||||
|
|
||||||
CPPFLAGS = /nologo /I C:\Java\jdk1.5.0_06\include /I C:\Java\jdk1.5.0_06\include\win32 /DUNICODE
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
link /nologo /dll /out:$(TARGET) $(OBJS) advapi32.lib user32.lib
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jstring Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValue(
|
JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValue(
|
||||||
JNIEnv * env, jobject obj, jstring subkey, jstring name)
|
JNIEnv * env, jobject obj, jstring subkey, jstring name)
|
||||||
{
|
{
|
||||||
const jchar * csubkey = env->GetStringChars(subkey, NULL);
|
const jchar * csubkey = env->GetStringChars(subkey, NULL);
|
||||||
|
@ -46,7 +46,7 @@ JNIEXPORT jstring Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jstring Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValueName(
|
JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_WindowsRegistry_getLocalMachineValueName(
|
||||||
JNIEnv * env, jobject obj, jstring subkey, jint index)
|
JNIEnv * env, jobject obj, jstring subkey, jint index)
|
||||||
{
|
{
|
||||||
const jchar * csubkey = env->GetStringChars(subkey, NULL);
|
const jchar * csubkey = env->GetStringChars(subkey, NULL);
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue