.cpp
ファイルにいくつかのクロスプラットフォームコードがあり、CVPixelBuffer
からCVOpenGLESTextureRef/CVOpenGLTextureRef
に変換されています。 CoreVideo
関連の機能クロスプラットフォームを作るために、私はヘッダファイルに次の操作を行いますCVOpenGLESTextureGetNameでもCVOpenGLTextureGetNameでもtypedefを実行できません
#ifdef IOS_SHARED_SUPPORT
#import <OpenGLES/EAGL.h>
#import <CoreVideo/CoreVideo.h>
#import <CoreVideo/CVOpenGLESTexture.h>
#import <CoreVideo/CVOpenGLESTextureCache.h>
#endif // IOS_SHARED_SUPPORT
#ifdef MAC_SHARED_SUPPORT
#import <CoreVideo/CoreVideo.h>
#import <CoreVideo/CVOpenGLTexture.h>
#import <CoreVideo/CVOpenGLTextureCache.h>
#import <AppKit/AppKit.h>
#endif // MAC_SHARED_SUPPORT
#ifdef IOS_SHARED_SUPPORT
typedef CVOpenGLESTextureRef CVOpenGLPlatformTexture;
typedef CVOpenGLESTextureCacheRef CVOpenGLPlatformTextureCache;
typedef CVOpenGLESTextureGetName CVOpenGLPlatformTextureGetName; // error!!!
#endif
#ifdef MAC_SHARED_SUPPORT
typedef CVOpenGLTextureRef CVOpenGLPlatformTexture;
typedef CVOpenGLTextureCacheRef CVOpenGLPlatformTextureCache;
typedef CVOpenGLTextureGetName CVOpenGLPlatformTextureGetName; // error!!!
#endif
それは、言う「不明なタイプ名 『CVOpenGLESTextureGetName』;もしかして 『CVOpenGLESTextureRef』?」 <CoreVideo/CVOpenGLESTexture.h>
が含まれていても、CVOpenGLESTextureRef
がtypedefに使用されているにもかかわらず、が含まれています。
関数はtypedefされていない可能性がありますか?
実験をお勧めしますか?
ありがとうございます。
ありがとうございます! 'constexpr'を削除しようとしましたが、許可されていません。 'constexpr'修飾子はプリプロセッサーが本当の' CoreVideo'関数のオブジェクトコードを変更しないことを保証していますか? –
@Olia_Pavliuk - これはプリプロセッサ修飾子ではありません。これは型システムの一部です。基本的には、ポインタは常に同じアドレスに評価されるコンパイル時定数式です。 – StoryTeller