<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1168</bug_id>
          
          <creation_ts>2015-06-30 18:06:28 +0200</creation_ts>
          <short_desc>GLhandleARB redefined in gltypes.h on osx</short_desc>
          <delta_ts>2015-09-27 01:33:34 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jocl</product>
          <component>opencl</component>
          <version>2.3.2</version>
          <rep_platform>pc_x86_64</rep_platform>
          <op_sys>macosx</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeffrey Kuhn">drjrkuhn</reporter>
          <assigned_to name="Wade Walker">wwalker3</assigned_to>
          <cc>sgothel</cc>
    
    <cc>wwalker3</cc>
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4742</commentid>
    <comment_count>0</comment_count>
      <attachid>701</attachid>
    <who name="Jeffrey Kuhn">drjrkuhn</who>
    <bug_when>2015-06-30 18:06:28 +0200</bug_when>
    <thetext>Created attachment 701
Patch file for /jocl/make/stub_includes/GL3/gl3.h

OSX Version 10.10.3 (Yosemite)

I tried a fresh build of JOCL on OSX and found a compiler error.

The OSX Framework implementation of OpenGL changed the typedef of GLhanldeARB from &apos;unsigned int&apos; to &apos;void *&apos; in /System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h

The version in /jocl/make/stub_includes/GL3/gl3.h tries to redefine GLhandleARB to unsigned int.

I suggest the following change to gl3.h (patch file attached)

#ifndef GL_ARB_shader_objects
/* GL types for program/shader text and shader object handles */
typedef char GLcharARB;
#if defined(__APPLE__)
typedef void *GLhandleARB;
#else
typedef unsigned int GLhandleARB;
#endif
#endif</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4743</commentid>
    <comment_count>1</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2015-06-30 19:30:05 +0200</bug_when>
    <thetext>Sounds good, I&apos;ll check into why this doesn&apos;t work on Yosemite. We do nightly builds for Mac, but I think it&apos;s using a slightly older version of the OS, so maybe this recently changed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4751</commentid>
    <comment_count>2</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2015-07-04 20:54:01 +0200</bug_when>
    <thetext>Confirmed this bug on Mac OS X 10.10.4 with the latest JOCL code compiled under Java 1.8.0_45. It looks like others have run into this problem as well (e.g. GLEW, described at http://sourceforge.net/p/glew/bugs/206/). Checking to see if Jeff&apos;s proposed solution will work on older versions of OS X.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4752</commentid>
    <comment_count>3</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2015-07-05 16:30:43 +0200</bug_when>
    <thetext>OK, it looks like Khronos fixed it just the way Jeff suggested: https://www.khronos.org/bugzilla/show_bug.cgi?id=762

After Atlassian reported it to them: https://bitbucket.org/alfonse/glloadgen/issue/33/mac-compilation-error

So I&apos;ll add the same text that you see in https://www.opengl.org/registry/api/GL/glext.h:

#ifdef __APPLE__
typedef void *GLhandleARB;
#else
typedef unsigned int GLhandleARB;
#endif</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4753</commentid>
    <comment_count>4</comment_count>
    <who name="Wade Walker">wwalker3</who>
    <bug_when>2015-07-05 17:35:15 +0200</bug_when>
    <thetext>Resolved in commit 5a5a23a533df0ec5f47f94a7bda901e703b25040</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>701</attachid>
            <date>2015-06-30 18:06:28 +0200</date>
            <delta_ts>2015-06-30 18:06:28 +0200</delta_ts>
            <desc>Patch file for /jocl/make/stub_includes/GL3/gl3.h</desc>
            <filename>gl3.patch</filename>
            <type>text/plain</type>
            <size>566</size>
            <attacher name="Jeffrey Kuhn">drjrkuhn</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL21ha2Uvc3R1Yl9pbmNsdWRlcy9HTDMvZ2wzLmggYi9tYWtlL3N0dWJfaW5j
bHVkZXMvR0wzL2dsMy5oCmluZGV4IDE3NmRkYjEuLjE2MWU3YmYgMTAwNjQ0Ci0tLSBhL21ha2Uv
c3R1Yl9pbmNsdWRlcy9HTDMvZ2wzLmgKKysrIGIvbWFrZS9zdHViX2luY2x1ZGVzL0dMMy9nbDMu
aApAQCAtMTUyMCw4ICsxNTIwLDEyIEBAIHR5cGVkZWYgcHRyZGlmZl90IEdMc2l6ZWlwdHJBUkI7
CiAjaWZuZGVmIEdMX0FSQl9zaGFkZXJfb2JqZWN0cwogLyogR0wgdHlwZXMgZm9yIHByb2dyYW0v
c2hhZGVyIHRleHQgYW5kIHNoYWRlciBvYmplY3QgaGFuZGxlcyAqLwogdHlwZWRlZiBjaGFyIEdM
Y2hhckFSQjsKKyNpZiBkZWZpbmVkKF9fQVBQTEVfXykKK3R5cGVkZWYgdm9pZCAqR0xoYW5kbGVB
UkI7CisjZWxzZQogdHlwZWRlZiB1bnNpZ25lZCBpbnQgR0xoYW5kbGVBUkI7CiAjZW5kaWYKKyNl
bmRpZgogCiAvKiBHTCB0eXBlIGZvciAiaGFsZiIgcHJlY2lzaW9uIChzMTBlNSkgZmxvYXQgZGF0
YSBpbiBob3N0IG1lbW9yeSAqLwogI2lmbmRlZiBHTF9BUkJfaGFsZl9mbG9hdF9waXhlbAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>