activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r882293 - in /activemq/sandbox/activemq-apollo/activemq-syscall/src/main: java/org/apache/activemq/syscall/ java/org/apache/activemq/syscall/jni/ native-package/
Date Thu, 19 Nov 2009 20:55:20 GMT
Author: chirino
Date: Thu Nov 19 20:55:20 2009
New Revision: 882293

URL: http://svn.apache.org/viewvc?rev=882293&view=rev
Log:
Adding conditionals so that it compiles on windows too

Modified:
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/NativeAllocation.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/CLibrary.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/IO.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/NativeAllocation.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/NativeAllocation.java?rev=882293&r1=882292&r2=882293&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/NativeAllocation.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/NativeAllocation.java
Thu Nov 19 20:55:20 2009
@@ -89,7 +89,7 @@
         assert off+len <= length;
         long ptr = pointer;
         if( off > 0 ) {
-            ptr = void_pointer_add(ptr, off);
+            ptr = byte_pointer_add(ptr, off);
         }
         return new NativeAllocation(ptr, len);
     }    
@@ -99,7 +99,7 @@
     }
     
     public long offset(long offset) {
-        return void_pointer_add(pointer, offset);
+        return byte_pointer_add(pointer, offset);
     }
 
     public long length() {

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/CLibrary.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/CLibrary.java?rev=882293&r1=882292&r2=882293&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/CLibrary.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/CLibrary.java
Thu Nov 19 20:55:20 2009
@@ -105,12 +105,6 @@
     // Generic void * helpers..
     //
     ///////////////////////////////////////////////////////////////////
-    
-    @JniMethod(cast="void *", accessor="add")
-    public static final native long void_pointer_add(
-            @JniArg(cast="void *") long ptr, 
-            long amount);
-
     public static final native void memmove (
             @JniArg(cast="void *") long dest, 
             @JniArg(cast="const void *") long src, 
@@ -123,7 +117,7 @@
     ///////////////////////////////////////////////////////////////////
     
     @JniMethod(cast="jbyte *", accessor="add")
-    public static final native long jbyte_pointer_add(
+    public static final native long byte_pointer_add(
             @JniArg(cast="jbyte *") long ptr, 
             long amount);
     
@@ -144,7 +138,7 @@
     ///////////////////////////////////////////////////////////////////
     
     @JniMethod(cast="jchar *", accessor="add")
-    public static final native long jchar_pointer_add(
+    public static final native long char_pointer_add(
             @JniArg(cast="jchar *") long ptr, 
             long amount);
 
@@ -165,7 +159,7 @@
     ///////////////////////////////////////////////////////////////////
     
     @JniMethod(cast="jshort *", accessor="add")
-    public static final native long jshort_pointer_add(
+    public static final native long short_pointer_add(
             @JniArg(cast="jshort *") long ptr, 
             long amount);
 
@@ -187,7 +181,7 @@
     ///////////////////////////////////////////////////////////////////
     
     @JniMethod(cast="jint *", accessor="add")
-    public static final native long jint_pointer_add(
+    public static final native long int_pointer_add(
             @JniArg(cast="jint *") long ptr, 
             long amount);
     
@@ -209,7 +203,7 @@
     ///////////////////////////////////////////////////////////////////
 
     @JniMethod(cast="jlong *", accessor="add")
-    public static final native long jlong_pointer_add(
+    public static final native long long_pointer_add(
             @JniArg(cast="jlong *") long ptr, 
             long amount);
 
@@ -230,7 +224,7 @@
     ///////////////////////////////////////////////////////////////////
     
     @JniMethod(cast="jfloat *", accessor="add")
-    public static final native long jfloat_pointer_add(
+    public static final native long float_pointer_add(
             @JniArg(cast="jfloat *") long ptr, 
             long amount);
 
@@ -251,7 +245,7 @@
     ///////////////////////////////////////////////////////////////////
     
     @JniMethod(cast="jdouble *", accessor="add")
-    public static final native long jdouble_pointer_add(
+    public static final native long double_pointer_add(
             @JniArg(cast="jdouble *") long ptr, 
             long amount);
 

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/IO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/IO.java?rev=882293&r1=882292&r2=882293&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/IO.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/IO.java
Thu Nov 19 20:55:20 2009
@@ -210,48 +210,46 @@
     @JniMethod(conditional="#ifdef HAVE_FCNTL_FUNCTION")
     public static final native int fcntl(int fd, int cmd, long arg);
 
-    
     @JniMethod(cast="size_t")
-    public static final native long write(
+    public static final native long read(
             int fd, 
-            @JniArg(cast="const void *") long buffer, 
+            @JniArg(cast="void *") long buffer, 
             @JniArg(cast="size_t") long length);
-    
-    
-    @JniMethod(cast="size_t")
-    public static final native long pwrite(
-            int fd, 
-            @JniArg(cast="const void *") long buffer, 
-            @JniArg(cast="size_t") long length,
-            @JniArg(cast="size_t") long offset);
-
-    @JniMethod(cast="size_t")
-    public static final native long writev(
-            int fd, 
-            @JniArg(cast="const struct iovec *") long iov, 
-            int count);
 
     @JniMethod(cast="size_t")
-    public static final native long read(
+    public static final native long write(
             int fd, 
-            @JniArg(cast="void *") long buffer, 
+            @JniArg(cast="const void *") long buffer, 
             @JniArg(cast="size_t") long length);
 
-    @JniMethod(cast="size_t")
+    @JniMethod(cast="size_t", conditional="#ifdef HAVE_PREAD_FUNCTION")
     public static final native long pread(
             int fd, 
             @JniArg(cast="void *") long buffer, 
             @JniArg(cast="size_t") long length,
             @JniArg(cast="size_t") long offset);
 
-    @JniMethod(cast="size_t")
+    @JniMethod(cast="size_t", conditional="#ifdef HAVE_PREAD_FUNCTION")
+    public static final native long pwrite(
+            int fd, 
+            @JniArg(cast="const void *") long buffer, 
+            @JniArg(cast="size_t") long length,
+            @JniArg(cast="size_t") long offset);
+
+    @JniMethod(cast="size_t", conditional="#ifdef HAVE_READV_FUNCTION")
     public static final native long readv(
             int fd, 
             @JniArg(cast="const struct iovec *") long iov, 
             int count);
 
+    @JniMethod(cast="size_t", conditional="#ifdef HAVE_READV_FUNCTION")
+    public static final native long writev(
+            int fd, 
+            @JniArg(cast="const struct iovec *") long iov, 
+            int count);
+
 
-    @JniClass(flags={ClassFlag.STRUCT})
+    @JniClass(flags={ClassFlag.STRUCT}, conditional="#ifdef HAVE_READV_FUNCTION")
     static public class iovec {
 
         static {
@@ -262,7 +260,7 @@
         @JniMethod(flags={CONSTANT_INITIALIZER})
         private static final native void init();
 
-        @JniField(flags={FieldFlag.CONSTANT}, accessor="sizeof(struct iovec)")
+        @JniField(flags={FieldFlag.CONSTANT}, accessor="sizeof(struct iovec)", conditional="#ifdef
HAVE_READV_FUNCTION")
         public static int SIZEOF;
         
         @JniField(cast="char *")
@@ -270,17 +268,19 @@
         @JniField(cast="size_t")
         public long iov_len;
         
+        @JniMethod(conditional="#ifdef HAVE_READV_FUNCTION")
         public static final native void memmove (
                 @JniArg(cast="void *", flags={NO_IN, CRITICAL}) iovec dest, 
                 @JniArg(cast="const void *") long src, 
                 @JniArg(cast="size_t") long size);
         
+        @JniMethod(conditional="#ifdef HAVE_READV_FUNCTION")
         public static final native void memmove (
                 @JniArg(cast="void *") long dest, 
                 @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) iovec src, 
                 @JniArg(cast="size_t") long size);
         
-        @JniMethod(cast="struct iovec *", accessor="add")
+        @JniMethod(cast="struct iovec *", accessor="add", conditional="#ifdef HAVE_READV_FUNCTION")
         public static final native long iovec_add(
                 @JniArg(cast="struct iovec *") long ptr, 
                 long amount);        

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac?rev=882293&r1=882292&r2=882293&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
Thu Nov 19 20:55:20 2009
@@ -54,6 +54,8 @@
 
 AC_CHECK_LIB([c], [fcntl],[AC_DEFINE([HAVE_FCNTL_FUNCTION], [1], [Define to 1 if you have
the fcntl function.])])
 AC_CHECK_LIB([c], [posix_memalign],[AC_DEFINE([HAVE_POSIX_MEMALIGN_FUNCTION], [1], [Define
to 1 if you have the posix_memalign function.])])
+AC_CHECK_LIB([c], [pread],[AC_DEFINE([HAVE_PREAD_FUNCTION], [1], [Define to 1 if you have
the pread function.])])
+AC_CHECK_LIB([c], [readv],[AC_DEFINE([HAVE_READV_FUNCTION], [1], [Define to 1 if you have
the readv function.])])
               
 AC_CHECK_HEADER([sys/errno.h],[AC_DEFINE([HAVE_SYS_ERRNO_H], [1], [Define to 1 if you have
the <sys/errno.h> header file.])])
 AC_CHECK_HEADER([sys/stat.h],[AC_DEFINE([HAVE_SYS_STAT_H], [1], [Define to 1 if you have
the <sys/stat.h> header file.])])



Mime
View raw message