Skip to content

Commit fbd89a7

Browse files
committed
libfoundation: Add MCHashBool
This patch adds an MCHashBool function which hashes a C bool value.
1 parent 7879215 commit fbd89a7

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

libfoundation/include/foundation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,9 @@ extern "C" {
12811281
// the same from version to version. In particular, never serialize a hash
12821282
// value - recompute on unserialization of the object.
12831283

1284+
// Return a hash for the given bool.
1285+
MC_DLLEXPORT hash_t MCHashBool(bool);
1286+
12841287
// Return a hash for the given integer.
12851288
MC_DLLEXPORT hash_t MCHashInteger(integer_t);
12861289
MC_DLLEXPORT hash_t MCHashUInteger(uinteger_t);

libfoundation/src/foundation-core.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ void MCMemoryDeleteArray(void *p_array)
213213

214214
////////////////////////////////////////////////////////////////////////////////
215215

216+
MC_DLLEXPORT_DEF
217+
hash_t MCHashBool(bool b)
218+
{
219+
return hash_t(b);
220+
}
221+
216222
MC_DLLEXPORT_DEF
217223
hash_t MCHashInteger(integer_t i)
218224
{

0 commit comments

Comments
 (0)