Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix R15 compatibility #2

Merged
merged 1 commit into from

2 participants

andrewtj Andrew Thompson
andrewtj

A couple of minor fixes to make the driver work on R15:

  • Define ErlDrvSizeT for pre-R15 systems
  • Update syslogdrv_output to use ErlDrvSizeT
  • Add missing driver entries that are now required

Cheers,
Andrew

andrewtj andrewtj Fix R15 compatibility
* Define ErlDrvSizeT for pre-R15 systems
* Update syslogdrv_output to use ErlDrvSizeT
* Add missing driver entries that are now required
bb32026
andrewtj

Any feedback @Vagabond?

Andrew Thompson
Owner

This looks fine, but I haven't had time to actually test it.

andrewtj

Got any room for this on your agenda?

Andrew Thompson Vagabond merged commit 2a301dd into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 4, 2012
  1. andrewtj

    Fix R15 compatibility

    andrewtj authored
    * Define ErlDrvSizeT for pre-R15 systems
    * Update syslogdrv_output to use ErlDrvSizeT
    * Add missing driver entries that are now required
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 1 deletion.
  1. +9 −1 c_src/syslog_drv.c
10 c_src/syslog_drv.c
View
@@ -29,6 +29,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ei.h>
#include <erl_driver.h>
+/* for pre-R15 compatibility */
+#if ERL_DRV_EXTENDED_MAJOR_VERSION < 2
+#define ErlDrvSizeT int
+#endif
+
/* atoms which are sent to erlang */
static ErlDrvTermData am_ok;
static ErlDrvTermData am_value;
@@ -70,7 +75,7 @@ static void syslogdrv_stop(ErlDrvData handle)
}
/* messages from erlang */
-static void syslogdrv_output(ErlDrvData handle, char *buff, int bufflen)
+static void syslogdrv_output(ErlDrvData handle, char *buff, ErlDrvSizeT bufflen)
{
syslogdrv_t* d = (syslogdrv_t*)handle;
int index = 0, version, arity;
@@ -168,5 +173,8 @@ DRIVER_INIT(syslogdrv)
syslogdrv_driver_entry.driver_name = "syslog_drv";
syslogdrv_driver_entry.finish = NULL;
syslogdrv_driver_entry.outputv = NULL;
+ syslogdrv_driver_entry.extended_marker = ERL_DRV_EXTENDED_MARKER;
+ syslogdrv_driver_entry.major_version = ERL_DRV_EXTENDED_MAJOR_VERSION;
+ syslogdrv_driver_entry.minor_version = ERL_DRV_EXTENDED_MINOR_VERSION;
return &syslogdrv_driver_entry;
}
Something went wrong with that request. Please try again.