diff --git a/include/corosync/hdb.h b/include/corosync/hdb.h index bf1d45d8..08bc20f8 100644 --- a/include/corosync/hdb.h +++ b/include/corosync/hdb.h @@ -41,8 +41,16 @@ #include #include #include +#include +#include -typedef unsigned long long hdb_handle_t; +typedef uint64_t hdb_handle_t; + +/* + * Formatting for string printing on 32/64 bit systems + */ +#define HDB_D_FORMAT "%"PRIu64 +#define HDB_X_FORMAT "%"PRIx64 enum HDB_HANDLE_STATE { HDB_HANDLE_STATE_EMPTY, diff --git a/test/testconfdb.c b/test/testconfdb.c index 874e0eed..f9a3daf6 100644 --- a/test/testconfdb.c +++ b/test/testconfdb.c @@ -71,7 +71,7 @@ static void print_config_tree(confdb_handle_t handle, hdb_handle_t parent_object /* Show the keys */ res = confdb_key_iter_start(handle, parent_object_handle); if (res != CS_OK) { - printf( "error resetting key iterator for object %llu: %d\n", parent_object_handle, res); + printf( "error resetting key iterator for object "HDB_X_FORMAT": %d\n", parent_object_handle, res); return; } @@ -86,7 +86,7 @@ static void print_config_tree(confdb_handle_t handle, hdb_handle_t parent_object /* Show sub-objects */ res = confdb_object_iter_start(handle, parent_object_handle); if (res != CS_OK) { - printf( "error resetting object iterator for object %llu: %d\n", parent_object_handle, res); + printf( "error resetting object iterator for object "HDB_X_FORMAT": %d\n", parent_object_handle, res); return; } @@ -95,14 +95,14 @@ static void print_config_tree(confdb_handle_t handle, hdb_handle_t parent_object res = confdb_object_parent_get(handle, object_handle, &parent); if (res != CS_OK) { - printf( "error getting parent for object %lld: %d\n", object_handle, res); + printf( "error getting parent for object "HDB_X_FORMAT": %d\n", object_handle, res); return; } for (i=0; i