[問題] 兩個struct交互使用的宣告問題
各位大大,小弟最近閱讀openssl source code,並試著改寫
有個部分感到很疑惑,兩個檔案的程式碼如下:
-----------------------------------
//在 ossl_type.h
typedef struct evp_cipher_st EVP_CIPHER
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX
------------------------------------
//在evp.h
struct evp_cipher_st
{
int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc);
//其他略
}
struct evp_cipher_ctx_st
{
const EVP_CIPHER *cipher;
//其他略
}
------------------------------------
這兩個結構交互使用,不管如何改先後順序,compiler只會認得先宣告的struct
請問有方法讓compiler都認得嗎? 感謝回覆!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.200.169.82
→
05/10 18:43, , 1F
05/10 18:43, 1F
→
05/11 10:04, , 2F
05/11 10:04, 2F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章