                                    in case getEnumCL x of
                                      CL_CONTEXT_PLATFORM_ 
                                        -> CL_CONTEXT_PLATFORM 
+                                          (intPtrToPtr . fromIntegral $ y) : ys
+                                     CL_CGL_SHAREGROUP_KHR_ 
+                                       -> CL_CGL_SHAREGROUP_KHR 
                                           (intPtrToPtr . fromIntegral $ y) : ys
   
 -- -----------------------------------------------------------------------------

-- | Specifies a context property name and its corresponding value.
data CLContextProperty = CL_CONTEXT_PLATFORM CLPlatformID 
                         -- ^ Specifies the platform to use.
                       deriving( Show )

packContextProperties :: [CLContextProperty] -> [CLContextProperty_]
packContextProperties [] = [0]
packContextProperties (CL_CONTEXT_PLATFORM pid : xs) = getCLValue CL_CONTEXT_PLATFORM_ 
                                                       : (fromIntegral . ptrToIntPtr $ pid) 
                                                       : packContextProperties xs

unpackContextProperties :: [CLContextProperty_] -> [CLContextProperty]
unpackContextProperties [] = error "non-exhaustive Context Property list"

#c
enum CLContextProperties {
  cL_CONTEXT_PLATFORM_=CL_CONTEXT_PLATFORM,
#ifdef __APPLE__
  cL_CGL_SHAREGROUP_KHR_=CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE
#else
  cL_GL_CONTEXT_KHR_=CL_GL_CONTEXT_KHR,
  cL_EGL_DISPLAY_KHR_=CL_EGL_DISPLAY_KHR,
  cL_GLX_DISPLAY_KHR_=CL_GLX_DISPLAY_KHR,
  cL_WGL_HDC_KHR_=CL_WGL_HDC_KHR,
  cL_CGL_SHAREGROUP_KHR_=CL_CGL_SHAREGROUP_KHR
#endif
  };
#endc
{#enum CLContextProperties {upcaseFirstLetter} #}
