<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 02/06/2015 09:44 PM, Chad Versace
      wrote:<br>
    </div>
    <blockquote cite="mid:54D519A4.2050300@intel.com" type="cite">
      <pre wrap="">On 02/05/2015 09:05 AM, Emil Velikov wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">On 5 February 2015 at 13:12, Tapani <a class="moz-txt-link-rfc2396E" href="mailto:tapani.palli@intel.com"><tapani.palli@intel.com></a> wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">On 02/03/2015 07:09 PM, Emil Velikov wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">
On 23 January 2015 at 07:59, Tapani Pälli <a class="moz-txt-link-rfc2396E" href="mailto:tapani.palli@intel.com"><tapani.palli@intel.com></a> wrote:
</pre>
          </blockquote>
        </blockquote>
        <pre wrap="">...
</pre>
        <blockquote type="cite">
          <blockquote type="cite">
            <blockquote type="cite">
              <pre wrap="">+
+    uint32_t len = strlen(src) + strlen(prefix);
</pre>
            </blockquote>
            <pre wrap="">
So the function name changes from glHamSandwitch to GLES2HamSandwitch ?
In that case you'll need to subtract 2 from the len above.
</pre>
          </blockquote>
          <pre wrap="">
I believe only 1 because of the additional string terminator, but I consider
above cleaner than playing the +/- game (?)

</pre>
        </blockquote>
        <pre wrap="">You're correct - I've completely forgot about \0, also I agree with
your argument.

...
</pre>
        <blockquote type="cite">
          <blockquote type="cite">
            <blockquote type="cite">
              <pre wrap="">@@ -59,7 +97,28 @@ nacl_platform_dl_sym(struct wcore_platform *wc_self,
                       int32_t waffle_dl,
                       const char *name)
  {
-    return NULL;
+    struct nacl_platform *self = nacl_platform(wc_self);
+    char *nacl_name = NULL;
+    void *func = NULL;
+
+    if (!self->gl_dl)
+        if (!nacl_platform_dl_can_open(wc_self, waffle_dl))
</pre>
            </blockquote>
            <pre wrap="">
One should not be doing this - it's the user's responsibility to call
dl_can_open prior to dl_sym.
</pre>
          </blockquote>
          <pre wrap="">

Documentation does not seem to indicate mandatory call to dl_can_open(), it
just suggests that one can test if a dll can be opened this way. AFAICS one
can just start to dlsym() the required functions?

</pre>
        </blockquote>
        <pre wrap="">I believe the lack of documentation is due to historical reasons.

Imho it's a picky subject what is to be done, if one can do XX
context, but does not have (direct) library to dlsym the symbols from.
I believe I've annoyed Chad enough on the topic so I won't pick it up
again :-)

I would personally opt to updating the documentation, as afaics none
of the current implementations calls dl_can_open within dl_sym.
Obviously the final decision is not mine to make, so this is just my 2c.
</pre>
      </blockquote>
      <pre wrap="">
The way that Waffle's Linux and Mac platforms work today, the user doesn't
have to call waffle_dl_can_open(). When the user calls waffle_dl_sym(),
Waffle internally calls dlopen() if the user hasn't called waffle_dl_sym()
on that library before.
</pre>
    </blockquote>
    OK, thanks for this clarification.<br>
    <br>
    <blockquote cite="mid:54D519A4.2050300@intel.com" type="cite">
      <pre wrap="">
Tapani, when I reviewed it earlier, I
misundertood how you were internally using nacl_platform_dl_can_open() inside
nacl_platform_dl_sym(). But, now I think the way you're doing it is correct.
I retract my earlier review comment.

However, after looking more closely at the patch, it looks like
nacl_platform_dl_can_open() re-opens the library with dlopen()
each time the user calls waffle_dl_can_open().
</pre>
    </blockquote>
    <br>
    oops yes, it's missing the check, I will fix this.<br>
    <br>
    <blockquote cite="mid:54D519A4.2050300@intel.com" type="cite">
      <pre wrap="">

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
waffle mailing list
<a class="moz-txt-link-abbreviated" href="mailto:waffle@lists.freedesktop.org">waffle@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/waffle">http://lists.freedesktop.org/mailman/listinfo/waffle</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>