• 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
Compile Errors with Carbon Versu BSD Dynamic Library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compile Errors with Carbon Versu BSD Dynamic Library


  • Subject: Compile Errors with Carbon Versu BSD Dynamic Library
  • From: Mike Jackson <email@hidden>
  • Date: Mon, 11 Jul 2005 21:31:56 -0400

I have a current Xcode 2.1 project that I created as a "BSD Dynamic Library". Now I would like to start adding some carbon calls into the library so after some trials just decided to make a new project. The problem I am having is that the same code that compiles in the BSD project throws errors in the carbon project. Specifically here is the error:

/Users/mjackson/Projects/CarbonTest/NullPolicy.h:39: error: expected unqualified-id before '{' token
/Users/mjackson/Projects/CarbonTest/NullPolicy.h:56: error: expected unqualified-id before '{' token



At the bottom of this email is the complete NullPolicy.h file. I am using gcc 4.0 and can not figure out what the difference between the BSD Library Project and the Carbon Library Project, besides the obvious differences of the linking against the Carbon.framework.


Could some one throw me a bone and suggest what might be the problem? I am still "wet behind the ears" when it comes to C++. Thanks for the help.

---BEGIN FILE NullPolicy.h----

//////////////////////////////////////////////////////////////////////// ///////
//
// Copyright (c) 2002, Perry L. Miller IV
// All rights reserved.
// BSD License: http://www.opensource.org/licenses/bsd-license.html
//
//////////////////////////////////////////////////////////////////////// ///////


//////////////////////////////////////////////////////////////////////// ///////
//
// Policy classes regarding null pointers.
//
//////////////////////////////////////////////////////////////////////// ///////


#ifndef _USUL_POINTERS_NULL_POLICY_H_
#define _USUL_POINTERS_NULL_POLICY_H_




//////////////////////////////////////////////////////////////////////// ///////
//
// Policy class that permits null pointers.
//
//////////////////////////////////////////////////////////////////////// ///////


struct NullOkPolicy
{
template < class T > static void check ( const T *t ){} // <---- This Line
};



//////////////////////////////////////////////////////////////////////// ///////
//
// Policy class that does not permit null pointers.
//
//////////////////////////////////////////////////////////////////////// ///////


template
<
class ErrorPolicy_
>
struct NullBadPolicy
{
template < class T > static void check ( const T *t )
{
// This may look like redundancy, however, we do not know how many cpu
// cycles it takes to construct the error-policy. Further, this permits
// us to easily insert a breakpoint.
if ( 0x0 == t )
ErrorPolicy_ ( 1075270902, false, "Null pointer" );
}
};




#endif // _USUL_POINTERS_NULL_POLICY_H_


---END FILE---- --- Mike Jackson mike _at_ bluequartz dot net


_______________________________________________ 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
  • Follow-Ups:
    • Re: Compile Errors with Carbon Versu BSD Dynamic Library
      • From: Mike Jackson <email@hidden>
  • Prev by Date: Re: XCode 2.1 breakpoints not working for command line apps?
  • Next by Date: Re: Compile Errors with Carbon Versu BSD Dynamic Library
  • Previous by thread: Re: #pragma pack(push, n) doesn't work on GCC 4.0
  • Next by thread: Re: Compile Errors with Carbon Versu BSD Dynamic Library
  • Index(es):
    • Date
    • Thread