X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=util%2Fstring.hpp;h=bf87eab8ff5636622146407a5f2ec9b27899f2ae;hb=f1b882e65cb7da1344405d25d5c4db150785ee59;hp=58d0ce270945fb8b11fbbf4f157e340eca80e5a2;hpb=23d5278248d8f3deff5903d17b6d55cc503ef3a9;p=awesomized%2Flibmemcached diff --git a/util/string.hpp b/util/string.hpp index 58d0ce27..bf87eab8 100644 --- a/util/string.hpp +++ b/util/string.hpp @@ -2,7 +2,7 @@ * * DataDifferential Utility Library * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ + * Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -47,7 +47,11 @@ #define util_literal_param(X) (X), (static_cast((sizeof(X) - 1))) #define util_literal_param_size(X) static_cast(sizeof(X) - 1) +#define util_literal_compare_param(X) (static_cast((sizeof(X) - 1))), (X) + #define util_string_make_from_cstr(X) (X), ((X) ? strlen(X) : 0) +#define util_string_make_from_array(__array) (__array), (strlen(__array)) + #define util_array_length(__array) sizeof(__array)/sizeof(&__array)