bug-gnulib
[Top][All Lists]
Advanced

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

filemode with C++


From: John W. Eaton
Subject: filemode with C++
Date: Thu, 13 Jan 2011 19:03:34 -0500

Hi,

I'd like to use the filemode module in a C++ file but found that it
does not have extern "C" magic.  I started to submit a patch, but
stopped when I saw that filemode.h has

  # if HAVE_DECL_STRMODE
  #  include <string.h> /* FreeBSD, OpenBSD */
  #  include <unistd.h> /* NetBSD */
  # else
  void strmode (mode_t mode, char *str);
  # endif

  void filemodestring (struct stat const *statp, char *str);

and remembered there is a recommendation in the gnulib manual to not
surround system header files with an extern "C" block.

What's the best way to get declare these two functions extern "C" and
be consistent with gnulib conventions?

Is it safe to assume that if HAVE_DECL_STRMODE is true, strmode will
be declared extern "C"?

Thanks,

jwe



reply via email to

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