           portData <- case btProto of
               L2CAP -> do
                   -- Register the L2CAP PSM
-                  psm <- with port $ c_sdp_data_alloc SDPCUInt16
+                  psm <- with port $ c_sdp_data_alloc SDP_CUInt16
                   sdpListAppend_ l2capList psm
                   return $ Left psm
               RFCOMM -> do
                   -- Register the RFCOMM channel
                   sdpUUID16Create rfcommUuid RFCOMMProtocol
-                  channel <- with port $ c_sdp_data_alloc SDPCUInt8
+                  channel <- with port $ c_sdp_data_alloc SDP_CUInt8
                   rfcommList <- sdpListAppend nullPtr rfcommUuid
                   sdpListAppend_ rfcommList channel
                   sdpListAppend_ protoList rfcommList

          -- Add UUID profiles
          profileList <- setFoldM nullPtr (sdpProfiles info)
              $ \profileList profile -> do
              profileDesc <- mallocBytes {#sizeof sdp_profile_desc_t #}
              sdpUUID16Create (c_sdp_profile_desc_get_uuid profileDesc) profile
              {#set sdp_profile_desc_t.version #} profileDesc 0x0100 -- Magic number
              sdpListAppend profileList profileDesc
          
          throwErrnoIfNegative_ "sdp_set_profile_descs" $
            c_sdp_set_profile_descs record profileList

{#pointer *sdp_list_t         as SDPListPtr        -> C_SDPList #}
{#pointer *sdp_data_t         as SDPDataPtr        -> C_SDPData #}
{#pointer *sdp_session_t      as SDPSessionPtr     -> C_SDPSession #}

{#fun unsafe sdp_uuid128_create as c_sdp_uuid128_create
  {         `UUIDPtr'
