You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/10 20:03:31 UTC

[GitHub] [arrow] kou commented on a diff in pull request #13115: RFC: [Format] Add canonical include guard for C Data Interface

kou commented on code in PR #13115:
URL: https://github.com/apache/arrow/pull/13115#discussion_r869635008


##########
cpp/src/arrow/c/abi.h:
##########
@@ -60,6 +63,11 @@ struct ArrowArray {
   void* private_data;
 };
 
+#endif  // ARROW_C_DATA_H

Review Comment:
   It seems that this mixes `extern "C" {...}` and `#ifndef ... #endif`:
   
   ```c
   #ifndef ARROW_C_DATA_H
   #define ARROW_C_DATA_H
   
   #ifdef __cplusplus
   extern "C" {
   #endif
   
   #endif  // ARROW_C_DATA_H
   
   #ifndef ARROW_C_STREAM_H
   #define ARROW_C_STREAM_H
   
   #ifdef __cplusplus
   }
   #endif
   
   #endif  // ARROW_C_STREAM_H
   ```
   
   I think that it may not be safe. How about avoiding the mix?
   
   ```c
   #ifndef ARROW_C_DATA_H
   #define ARROW_C_DATA_H
   
   #ifdef __cplusplus
   extern "C" {
   #endif
   
   #ifdef __cplusplus
   }
   #endif
   
   #endif  // ARROW_C_DATA_H
   
   #ifndef ARROW_C_STREAM_H
   #define ARROW_C_STREAM_H
   
   #ifdef __cplusplus
   extern "C" {
   #endif
   
   #ifdef __cplusplus
   }
   #endif
   
   #endif  // ARROW_C_STREAM_H
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org