From c25c11408233ddfecc0c5437c8608612f04567f5 Mon Sep 17 00:00:00 2001 From: heck Date: Tue, 8 Mar 2022 13:27:56 +0100 Subject: [PATCH] prtotype: prefix libc99 usage with :: --- test/test_nr1.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/test_nr1.cc b/test/test_nr1.cc index 46561d6..3a69452 100644 --- a/test/test_nr1.cc +++ b/test/test_nr1.cc @@ -434,7 +434,7 @@ namespace pEp { class TestStruct1 { public: // Create a new instance - TestStruct1(int i, Test_enum e, const std::string& str) + TestStruct1(int i, ::Test_enum e, const std::string& str) { pEpLogClass("called"); _c_struct_p = ::new_test_struct(0, ONE, nullptr); //dont use raw-setters @@ -453,13 +453,13 @@ namespace pEp { // Best to use this constructor, as the object is in a valid state when the wrapped // c_struct_pp is known - TestStruct1(bool is_owner, Test_struct1** c_struct_pp) + TestStruct1(bool is_owner, ::Test_struct1** c_struct_pp) { pEpLogClass("called"); bind(is_owner, c_struct_pp); } - void bind(bool is_owner, Test_struct1** c_struct_pp) + void bind(bool is_owner, ::Test_struct1** c_struct_pp) { if (c_struct_pp == nullptr) { throw Exception{ EXSTR("cant bind on a nullptr") }; @@ -508,7 +508,7 @@ namespace pEp { } pEp::POD c_int{}; - pEp::POD c_enum{}; + pEp::POD<::Test_enum> c_enum{}; pEp::String c_str{}; static bool log_enabled; @@ -553,10 +553,10 @@ int main() // value types are being copied around (stack) static_assert(std::is_pod::value && !std::is_pointer::value, "not an integral"); static_assert( - std::is_pod::value && !std::is_pointer::value, + std::is_pod<::Test_enum>::value && !std::is_pointer<::Test_enum>::value, "not an integral"); static_assert( - std::is_pod::value && !std::is_pointer::value, + std::is_pod<::Test_struct1>::value && !std::is_pointer<::Test_struct1>::value, "not an integral"); // pEp::Utils::readKey(); @@ -656,6 +656,7 @@ int main() } } + // Struct if (0) { // create { @@ -664,7 +665,7 @@ int main() pEpLog(pstruct1.c_enum); pEpLog(pstruct1.c_str); - Test_struct1* c_struct1 = pstruct1; + ::Test_struct1* c_struct1 = pstruct1; pEpLog(c_struct1->c_int); pEpLog(c_struct1->c_enum); pEpLog(c_struct1->c_str); @@ -673,7 +674,7 @@ int main() // wrap { - Test_struct1* c_struct1 = new_test_struct(0, ONE, "pEp"); + ::Test_struct1* c_struct1 = new_test_struct(0, ONE, "pEp"); pEpLog(c_struct1->c_int); pEpLog(c_struct1->c_enum); pEpLog(c_struct1->c_str);