Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

R15 compatibility.

R15B introduced some incompatible changes in driver interface.
Some driver callbacks started using ErlDrvSizeT and ErlDrvSSizeT
typedef instead of int.
This patch changes callbacks to use the new typedefs and provides
compatibility fallbacks for older OTP versions.
  • Loading branch information...
commit f0f05ea3b091988f6937aa63eeb3d2cb5652fc5e 1 parent 6987a0a
@rraptorr rraptorr authored badlop committed
View
4 c_src/exmpp_compress_zlib.c
@@ -95,9 +95,9 @@ exmpp_compress_zlib_stop(ErlDrvData drv_data)
driver_free(edd);
}
-static int
+static ErlDrvSSizeT
exmpp_compress_zlib_control(ErlDrvData drv_data, unsigned int command,
- char *buf, int len, char **rbuf, int rlen)
+ char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen)
{
struct exmpp_compress_zlib_data *edd;
int ret, index, type, type_size;
View
10 c_src/exmpp_driver.h
@@ -25,6 +25,16 @@
#include <erl_driver.h>
/*
+ * R15B changed several driver callbacks to use ErlDrvSizeT and
+ * ErlDrvSSizeT typedefs instead of int.
+ * This provides missing typedefs on older OTP versions.
+ */
+#if ERL_DRV_EXTENDED_MAJOR_VERSION < 2
+typedef int ErlDrvSizeT;
+typedef int ErlDrvSSizeT;
+#endif
+
+/*
* This macro is used to stringify the driver name in the driver's
* ErlDrvEntry. One use it like this:
* static ErlDrvEntry driver_entry = {
View
4 c_src/exmpp_stringprep.c
@@ -111,9 +111,9 @@ static int compose(int ch1, int ch2);
* Erlang port driver callbacks.
* ------------------------------------------------------------------- */
-static int
+static ErlDrvSSizeT
exmpp_stringprep_control(ErlDrvData drv_data, unsigned int command,
- char *buf, int len, char **rbuf, int rlen)
+ char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen)
{
int i, j, pos;
unsigned char c;
View
4 c_src/exmpp_tls_openssl.c
@@ -162,9 +162,9 @@ exmpp_tls_openssl_stop(ErlDrvData drv_data)
driver_free(edd);
}
-static int
+static ErlDrvSSizeT
exmpp_tls_openssl_control(ErlDrvData drv_data, unsigned int command,
- char *buf, int len, char **rbuf, int rlen)
+ char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen)
{
struct exmpp_tls_openssl_data *edd;
int ret, index, arity, type, type_size, flag;
View
4 c_src/exmpp_xml_expat.c
@@ -138,9 +138,9 @@ exmpp_xml_stop(ErlDrvData drv_data)
driver_free(edd);
}
-static int
+static ErlDrvSSizeT
exmpp_xml_control(ErlDrvData drv_data, unsigned int command,
- char *buf, int len, char **rbuf, int rlen)
+ char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen)
{
struct exmpp_xml_data *edd;
ei_x_buff *to_return;
View
4 c_src/exmpp_xml_expat_legacy.c
@@ -116,9 +116,9 @@ exmpp_xml_stop(ErlDrvData drv_data)
driver_free(edd);
}
-static int
+static ErlDrvSSizeT
exmpp_xml_control(ErlDrvData drv_data, unsigned int command,
- char *buf, int len, char **rbuf, int rlen)
+ char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen)
{
struct exmpp_xml_data *edd;
ei_x_buff *to_return;
View
4 c_src/exmpp_xml_libxml2.c
@@ -144,9 +144,9 @@ exmpp_xml_stop(ErlDrvData drv_data)
driver_free(edd);
}
-static int
+static ErlDrvSSizeT
exmpp_xml_control(ErlDrvData drv_data, unsigned int command,
- char *buf, int len, char **rbuf, int rlen)
+ char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen)
{
struct exmpp_xml_data *edd;
ei_x_buff *to_return;
Please sign in to comment.
Something went wrong with that request. Please try again.