Компьютерный форум OSzone.net  

Компьютерный форум OSzone.net (http://forum.oszone.net/index.php)
-   Программирование и базы данных (http://forum.oszone.net/forumdisplay.php?f=21)
-   -   Как устранить множественное объявление типов (http://forum.oszone.net/showthread.php?t=343743)

Apock 20-01-2020 22:28 2905980

Как устранить множественное объявление типов
 
Всем доброго времени суток. Есть у меня исходник консольного приложения для Visual Studio на C. Я пытаюсь переписать его под С++ и VCL на С++ Builder 10.3.
В своей работе приложение использует OpenCL. Вот на этом этапе у меня возникла сложность. В cl_platform.h есть такие строки:
Код:

#include <stdint.h>

/* scalar types  */
typedef int8_t          cl_char;
typedef uint8_t        cl_uchar;
typedef int16_t        cl_short    __attribute__((aligned(2)));
typedef uint16_t        cl_ushort  __attribute__((aligned(2)));
typedef int32_t        cl_int      __attribute__((aligned(4)));
typedef uint32_t        cl_uint    __attribute__((aligned(4)));
typedef int64_t        cl_long    __attribute__((aligned(8)));
typedef uint64_t        cl_ulong    __attribute__((aligned(8)));

typedef uint16_t        cl_half    __attribute__((aligned(2)));
typedef float          cl_float    __attribute__((aligned(4)));
typedef double          cl_double  __attribute__((aligned(8)));

И при компиляции я получаю следующее:
Цитата:

[bcc32 Error] stdint.h(231): E2238 Multiple declaration for 'LONGLONG'
Full parser context
oclengine.cpp(19): #include CL/cl.h
cl.h(30): #include CL/cl_platform.h
cl_platform.h(211): #include c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl\stdint.h
[bcc32 Error] winnt.h(796): E2344 Earlier declaration of 'LONGLONG'
Full parser context
oclengine.cpp(19): #include CL/cl.h
cl.h(30): #include CL/cl_platform.h
cl_platform.h(211): #include c:\program files (x86)\embarcadero\studio\20.0\include\windows\crtl\stdint.h
Конфликтующая строка в stdint.h using std::int64_t;
в winnt.h typedef __int64 LONGLONG;

Никак не могу понять решение проблемы. Менять родной код cl_platform стрёмно, а лезть в winnt и stdint вообще опасно)). В одном месте была у меня подобная проблема. Помогла замена #include <stdint.h> на <cstdint>. Но здесь не сработало.
Буду благодарен за любые идеи по этому вопросу.


Время: 20:11.

Время: 20:11.
© OSzone.net 2001-