7 #define DEFINE_SMARTPTR(func, type, name) \
8 struct deleter_##func { \
9 void operator()(type* p) {\
14 typedef std::unique_ptr<type, deleter_##func> name;
16 // Custom freeing functions
18 void closePtr(int *fd);
20 // Defining specializations of unique_ptr
22 DEFINE_SMARTPTR(free, char, CStringPtr);
23 DEFINE_SMARTPTR(closePtr, int, FdUniquePtr);
24 DEFINE_SMARTPTR(smack_accesses_free, smack_accesses, SmackAccessesPtr);
28 typedef FdUniquePtr SockUniquePtr;
29 typedef CStringPtr SmackLabelPtr;
30 typedef CStringPtr CookieUniquePtr;