This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] make <sys/sysmacros.h> compatible with glibc


On Sun, 2011-04-03 at 19:55 -0400, Christopher Faylor wrote:
> >+#define __INSIDE_CYGWIN_GNU_DEV__
> 
> I'd prefer a more descriptive name like "__DONT_DEFINE_INLINE_GNU_DEV" 

The __INSIDE_CYGWIN_foo__ naming scheme seems to be what is used
elsewhere for similar purposes, hence my choice here.

> but, then again, why do these have to be exported?  Why can't they just be
> always inlined?

I just followed what I observed with glibc:

$ cat test.c 
#include <sys/types.h>
#include <stdio.h>

int
main(void)
{
  int maj = 4, min = 64;	/* /dev/ttyS0 */
  printf("%d, %d = %d\n", maj, min, makedev(maj, min));
  return 0;
}

$ gcc -O0 test.c

$ nm a.out | grep " U "
         U __libc_start_main@@GLIBC_2.0
         U gnu_dev_makedev@@GLIBC_2.3.3
         U printf@@GLIBC_2.0

$ gcc -O1 test.c 

$ nm a.out | grep " U "
         U __libc_start_main@@GLIBC_2.0
         U printf@@GLIBC_2.0

Yaakov



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]