# Platform macros when importing C libraries with swiftpm?

**URL:** <https://forums.swift.org/t/platform-macros-when-importing-c-libraries-with-swiftpm/77560>\
**Category:** Using Swift\
**Tags:** c, c-interop\
**Created:** [January 30, 2025, 12:58pm UTC](https://forums.swift.org/t/platform-macros-when-importing-c-libraries-with-swiftpm/77560 "2025-01-30T12:58:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![givespam](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@givespam](https://forums.swift.org/u/givespam)\
**Post date:** [January 30, 2025, 12:58pm UTC](https://forums.swift.org/t/platform-macros-when-importing-c-libraries-with-swiftpm/77560/1 "2025-01-30T12:58:30Z")

</div>

hello,

so im importing cglm (C library) directly into swift, using Sources/Ccglm/include/header.h that includes cglm.h and everything works beautifully

but i want to use the applesimd.h which is included with cglm for some utilities to port cglm matrices to apple simd ones, but this header has this inside:

```swift
#if defined( __APPLE__ ) \
    && defined(SIMD_COMPILER_HAS_REQUIRED_FEATURES) \
    && defined(SIMD_BASE) \
    && defined(SIMD_TYPES) \
    && defined(SIMD_VECTOR_TYPES)

```

which usually using gcc or clang directly would be defined by default. but swiftpm doesnt seem to define these platform defines? because i get no access to extra functions that header provides.

do i have to set them manually on the cSettings? is there a way i can do this more "naturally"?  
thanks in advanced.

edit: using pure swiftpm, not xcode
