bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix a linker error when used by a C++ program


From: Bruno Haible
Subject: Re: Fix a linker error when used by a C++ program
Date: Mon, 19 Oct 2009 09:32:03 +0200
User-agent: KMail/1.9.9

Giuseppe Scrivano wrote:
> I am going to use gnulib in a C++ program.  This is the first problem I
> encountered.

> diff --git a/lib/nproc.h b/lib/nproc.h
> index fe5b57e..4a8b4d4 100644
> --- a/lib/nproc.h
> +++ b/lib/nproc.h
> @@ -18,4 +18,13 @@
>  
>  /* Written by Glen Lenker.  */
>  
> +/* Allow the use in C++ code.  */
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>  unsigned long int num_processors (void);
> +
> +#ifdef __cplusplus
> +}
> +#endif       /* C++ */

You are right, of course. I committed your patch for you.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]