From: Tay Ray Chuan Date: Sun, 01 Mar 2009 09:27:25 GMT Subject: Re: coding style: #ifdef blocks and real C blocks Message-ID: In-Reply-To: <7vbpsl8v7r.fsf@gitster.siamese.dyndns.org> Hi, On Sun, Mar 1, 2009 at 5:10 PM, Junio C Hamano wrote: > How about doing something like this: > >    #ifdef USE_CURL_MULTI >    #define active_slot_get get_active_multi_slot >    #else >    #define active_slot_get get_active_slot >    #endif > Nice. > Similarly, with something like this: > >    #ifdef USE_CURL_MULTI >    slot active_persistent_slot() { >            return persistent_connection ? get_active_slot() : get_active_multi_slot(); >    } >    #else >    slot active_persistent_slot() { >            return get_active_slot(); >    } >    #endif > > the call site can be #ifdef free, no? > Hmm, so I just do "slot = active_persistent_slot()" ? -- Cheers, Ray Chuan