Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix compile problems on windows with mingw #21

Merged
merged 4 commits into from

2 participants

Commits on Feb 5, 2013
  1. @hsn10

    Include windows.h if windows OS is detected and define minimum target…

    hsn10 authored
    … windows version to Windows XP
  2. @hsn10
Commits on Feb 7, 2013
  1. @hsn10
  2. @hsn10

    attach generated sources

    hsn10 authored
This page is out of date. Refresh to see the latest.
View
16 leveldbjni/pom.xml
@@ -173,8 +173,20 @@
</archive>
</configuration>
</plugin>
-
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
-
</project>
View
4 leveldbjni/src/main/java/org/fusesource/leveldbjni/internal/Util.java
@@ -91,8 +91,8 @@ static final native int link(
@JniMethod(conditional="defined(_WIN32) || defined(_WIN64)")
static final native int CreateHardLinkW(
- @JniArg(cast="LPCTSTR", flags={POINTER_ARG, UNICODE}) String target,
- @JniArg(cast="LPCTSTR", flags={POINTER_ARG, UNICODE}) String source,
+ @JniArg(cast="LPCWSTR", flags={POINTER_ARG, UNICODE}) String target,
+ @JniArg(cast="LPCWSTR", flags={POINTER_ARG, UNICODE}) String source,
@JniArg(cast="LPSECURITY_ATTRIBUTES", flags={POINTER_ARG}) long lpSecurityAttributes);
@JniMethod(flags={CONSTANT_GETTER})
View
23 leveldbjni/src/main/native-package/Makefile.win
@@ -0,0 +1,23 @@
+CC = gcc
+CXX = g++
+
+JDK = /c/java/jdk7
+PLATFORM = win32
+
+CPPFLAGS = -I/usr/local/include -I$(JDK)/include -I$(JDK)/include/$(PLATFORM)
+LDFLAGS = -L/usr/local/lib
+
+OBJS = src/leveldbjni.o src/leveldbjni_stats.o src/leveldbjni_structs.o \
+ src/buffer.o src/hawtjni.o
+
+.cc.o:
+ $(CXX) $(CPPFLAGS) -c $< -o $@
+
+.c.o:
+ $(CC) $(CPPFLAGS) -c $< -o $@
+
+leveldbjni.dll: $(OBJS)
+ $(CC) -shared -o $@ -Wl,"--strip-all" -Wl,"--export-all-symbols" $(OBJS) -lleveldb $(LDFLAGS) -lstdc++
+
+clean:
+ rm -f $(OBJS) *.dll
View
10 leveldbjni/src/main/native-package/src/leveldbjni.h
@@ -35,13 +35,15 @@
#ifdef HAVE_CONFIG_H
/* configure based build.. we will use what it discovered about the platform */
#include "config.h"
-#else
- #if defined(_WIN32) || defined(_WIN64)
+#endif
+#if defined(_WIN32) || defined(_WIN64)
/* Windows based build */
+ #define _WIN32_WINNT 0x0501
+ #include <windows.h>
+#endif
+#if !defined(HAVE_CONFIG_H) && (defined(_WIN32) || defined(_WIN64))
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
- #include <windows.h>
- #endif
#endif
#ifdef HAVE_UNISTD_H
Something went wrong with that request. Please try again.