paleolimbot commented on code in PR #221:
URL: https://github.com/apache/sedona-db/pull/221#discussion_r2429648821


##########
c/sedona-s2geography/src/geography_glue_bindgen.rs:
##########
@@ -14,9 +14,80 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
-#![allow(non_upper_case_globals)]
-#![allow(non_camel_case_types)]
-#![allow(non_snake_case)]
-#![allow(dead_code)]
 
-include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
+use std::os::raw::{c_char, c_int, c_void};
+
+#[repr(C)]
+pub struct ArrowSchema {
+    _private: [u8; 0],
+}
+
+#[repr(C)]
+pub struct ArrowArray {
+    _private: [u8; 0],
+}
+
+#[repr(C)]
+#[derive(Debug, Copy, Clone)]
+pub struct SedonaGeographyArrowUdf {
+    pub init: Option<
+        unsafe extern "C" fn(
+            self_: *mut SedonaGeographyArrowUdf,
+            arg_schema: *mut ArrowSchema,
+            options: *const c_char,
+            out: *mut ArrowSchema,
+        ) -> c_int,
+    >,
+    pub execute: Option<
+        unsafe extern "C" fn(
+            self_: *mut SedonaGeographyArrowUdf,
+            args: *mut *mut ArrowArray,
+            n_args: i64,
+            out: *mut ArrowArray,
+        ) -> c_int,
+    >,
+    pub get_last_error:
+        Option<unsafe extern "C" fn(self_: *mut SedonaGeographyArrowUdf) -> 
*const c_char>,
+    pub release: Option<unsafe extern "C" fn(self_: *mut 
SedonaGeographyArrowUdf)>,
+    pub private_data: *mut c_void,
+}
+
+macro_rules! declare_s2_c_udfs {
+    ($($name:ident),*) => {
+        $(
+            paste::item! {
+                pub fn [<SedonaGeographyInitUdf $name>](out: *mut 
SedonaGeographyArrowUdf);

Review Comment:
   We only use the macro within an unsafe block



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to