POV-Ray : Newsgroups : povray.programming : isosurf.cpp / inline & gcc : Re: isosurf.cpp / inline & gcc Server Time
4 Oct 2024 17:04:17 EDT (-0400)
  Re: isosurf.cpp / inline & gcc  
From: Warp
Date: 19 Mar 2003 04:57:02
Message: <3e783eed@news.povray.org>
ABX <abx### [at] abxartpl> wrote:
> http://new-brunswick.net/workshop/c++/faq/inline-functions.html#[9.5] ?

  No, that's not it.

"If you put the inline function's definition into a .cpp file, and if
it is called from some other .cpp file, you'll get an "unresolved
external" error from the linker."

  That's wrong. It should say "you may get", not "you'll get".
A compiler can (and in these cases should, AFAIK) create a regular
instance of the function which is used as a regular function call when
it's not possible to inline it (eg. because the code is not available
in the current cpp file). This way there's no linkage problem.
  I don't remember if gcc does this automatically, but at least you
can instruct it to do it with a compiler option.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.