           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

                      in withArray $ map (fromIntegral . byteSwap32) [w1,w2,w3,w4]

{#enum define SDPDataRep {
    SDP_UINT8  as SDPCUInt8
  , SDP_UINT16 as SDPCUInt16
  } deriving (Ix, Show, Eq, Read, Ord, Bounded) #}

{#enum define SDPConnectFlag {

          -- 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
