clover/api: Support MSVC

Three things:
1. MSVC dislikes mismatching declaration/definition of __declspec(dllexport).
   Since CL headers don't have the declspec, the implementations should't either.
2. An unnamed brace-initialization gets deduced as an initializer list, instead
   of a brace-constructed string. Just add the type name.
3. posix_memalign doesn't exist on Windows.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7680>
This commit is contained in:
Jesse Natalie
2020-11-18 18:37:54 -08:00
parent f88347cd22
commit 474baa04ed
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -123,7 +123,7 @@ clCreateProgramWithBinary(cl_context d_ctx, cl_uint n,
return { CL_INVALID_VALUE, {} };
try {
std::stringbuf bin( { (char*)p, l } );
std::stringbuf bin( std::string{ (char*)p, l } );
std::istream s(&bin);
return { CL_SUCCESS, module::deserialize(s) };