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

Re: Compile Errors with Carbon Versu BSD Dynamic Library


  • Subject: Re: Compile Errors with Carbon Versu BSD Dynamic Library
  • From: Mike Jackson <email@hidden>
  • Date: Tue, 12 Jul 2005 09:42:35 -0400

Figured out that "check" is already defined somewhere in Carbon.h or the files that it includes. So I used a #undef check just after the #includes and now it seems to compile.

On a related note, is there a compile time "#def" that I can evaluate against to figure out if I am compiling against the Carbon libs or should I just define my own in this particular build configuration?

Mike Jackson

On Jul 11, 2005, at 9:31 PM, Mike Jackson wrote:

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:
40bluequartz.net


This email sent to email@hidden



--- 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: Chris Espinosa <email@hidden>
References: 
 >Compile Errors with Carbon Versu BSD Dynamic Library (From: Mike Jackson <email@hidden>)

  • Prev by Date: Compile Errors with Carbon Versu BSD Dynamic Library
  • Next by Date: Bundle resource file not being loaded
  • Previous by thread: Compile Errors with Carbon Versu BSD Dynamic Library
  • Next by thread: Re: Compile Errors with Carbon Versu BSD Dynamic Library
  • Index(es):
    • Date
    • Thread