• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: kext and std C++ algorithms?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kext and std C++ algorithms?


  • Subject: Re: kext and std C++ algorithms?
  • From: "Duane Murphy" <email@hidden>
  • Date: Wed, 20 Aug 2008 05:01:37 -0700

That's what the documentation says, and indeed there are places where
templates do not work in the IOKit system. However, there is nothing
that prevents templates from working in a kext (IOKit or otherwise).
Templates are "just code" like everything else.

I have several template classes and functions already in my code. I'd
just like to use some of the more simple inline algorithms from the
standard library. I understand that the standard library is not linked
with the kext, but a large amount of the C++ part of the standard libray
does not require linking.

So, is there any simple way to allow a kext to at least see some of the
standard library header files?

Thanks,
 ...Duane

--- At Tue, 19 Aug 2008 22:49:12 -0700, Joseph Kelly wrote:

>Kext development uses a limited subset of C++ -- templates are not
>allowed, so no stl, no std::min()/max() etc. No RTTI either. Min and
>Max are easily implemented as macros (minus the type checking).
>Libkern provides you with some basic container classes, and an RTTI
>scheme.
>
>http://developer.apple.com/documentation/DeviceDrivers/Conceptual/
>IOKitFundamentals/Features/chapter_2_section_6.html#/
>/apple_ref/doc/uid/TP0000012-TPXREF105
>
>Joe K.
>
>On Aug 19, 2008, at 4:54 PM, Duane Murphy wrote:
>
>> How can I use some of the really basic template functions in the C++
>> library in a kext?
>>
>> I'd like to use some simple things, like min(), max(), for_each(),
>> find(), etc. These templates should work just fine in a kext, but the
>> kext project includes -nostdinc. How do I re-enable -nostdinc so
>> that I can
>>
>> #include <algorithms>
>>
>> Thanks,
>>
>> ...Duane

 ...Duane

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >kext and std C++ algorithms? (From: "Duane Murphy" <email@hidden>)
 >Re: kext and std C++ algorithms? (From: Joseph Kelly <email@hidden>)

  • Prev by Date: Unable to read symbols for...
  • Next by Date: Re: Pthread Priority
  • Previous by thread: Re: kext and std C++ algorithms?
  • Next by thread: Re: kext and std C++ algorithms?
  • Index(es):
    • Date
    • Thread