Fix C++ compile error in pal_io_common.h (#57188)
authorCaleb Cornett <Caleb.cornett@outlook.com>
Thu, 12 Aug 2021 03:31:57 +0000 (23:31 -0400)
committerGitHub <noreply@github.com>
Thu, 12 Aug 2021 03:31:57 +0000 (21:31 -0600)
* Cast pal_io_common.h calloc call

This fixes a compilation error when compiling the header as C++.

* Style fix

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
src/libraries/Native/Unix/Common/pal_io_common.h

index 8a9b4ad2fbd26ba628ce59649209a808b75d5ed9..0cd640cca9d47c30417b409ca68bacc2afd8a97f 100644 (file)
@@ -90,7 +90,7 @@ inline static int32_t Common_Poll(PollEvent* pollEvents, uint32_t eventCount, in
     }
     else
     {
-        pollfds = calloc(eventCount, sizeof(*pollfds));
+        pollfds = (struct pollfd*)calloc(eventCount, sizeof(*pollfds));
         if (pollfds == NULL)
         {
             return Error_ENOMEM;