<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Yes, I've worked around the issue with the compile-time defines that are different for the 32 and 64 bit architectures. However, it's not entirely clear why there's a requirement for the driver name to match the file name. It seems that it would be more flexible to allow them to be different.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 25, 2019 at 9:30 PM Michael Truog <<a href="mailto:mjtruog@gmail.com">mjtruog@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
On 6/25/19 2:17 PM, Serge Aleynikov wrote:<br>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">When writing a
port driver the "driver_name" field in the ErlDrvEntry
structure is defined to match the name of the driver file.</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Is it possible
to name the driver file differently from what's specified in
the ErlDrvEntry?</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I have two
architectures x86 and x64, and would like to distribute a
prebuilt library with my application in the 32 and 64 bit
flavors, and have the application choose the proper driver
filename depending on the target architecture of the host
machine. For this reason I am wondering if it's possible to
name a driver file as "myapp-x86" or "myapp-x64" with a driver
name field containing "myapp". Is that doable?</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Regards,</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Serge</div>
</div>
</blockquote>
Hi Serge,<br>
<br>
With the current Erlang/OTP source code, you can get this to work by
having driver_name be different for each file by using the
preprocessor to create the unique filename. You would effectively
be using the string "myapp-" #arch, though it would require a few
macros to expand properly (in the C/C++).<br>
<br>
Best Regards,<br>
Michael<br>
</div>
</blockquote></div>