On Mon, Nov 17, 2003 at 02:45:12PM -0500, Jeff Trawick wrote:
> re-troll^H^H^H^H^Hpost
> 
> Jeff Trawick wrote:
> >Currently, APR exports unqualified OS symbols to applications on some 
> >platforms.  These symbols include HPUX11=1, HPUX=1, NETBSD=1, SOLARIS2=8 
> >(or whatever), and others.  These shouldn't be added to compile flags since
> >
> >1) it can interfere with application defines
> >2) they aren't properly qualified with APR_
> >3) they aren't consistently implemented
> >
> >If we actually require some of these symbols in public header files, 
> >that probably needs to be fixed.  If the APR implementation needs it 
> >somewhere, something should be placed in apr_private.h instead.
> >
> >Comments?
> 
> I'm not anxious to jump on this at the moment, but I'm a little surprised 
> at the lack of comment given the amount of disagreement with the idea that 
> APR should provide a consistent indication of the platform in lieu of the 
> current mess.

I agree they need to be removed, they are an ugly leftover from a
copy'n'paste then search'n'replace-or-two from 1.3's Configure script.  
It's interesting looking for what is and isn't actually used, I did some
grepwork... the uses of -D's set in apr_hints.m4 by the public headers
which I found:

  include/apr_portable.h:#elif defined(DARWIN)
  include/apr_signal.h:#if defined(DARWIN) && !defined(__cplusplus) && 
!defined(_ANSI_SOURCE)
  include/apr_portable.h:#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
  include/apr_portable.h:#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
  include/apr_general.h:#if defined(CRAY) || (defined(__arm) && !defined(LINUX))

  include/apr.h:    defined(NEXT)
  include/apr_mmap.h:#  ifdef SUNOS4

vaguely sanitized script output attached showing all the -DBLAHs in
apr_hints.m4 and where they are (not) used in APR.

joe
AP_AUTH_DBM_USE_APR: NOT USED
APOLLO: NOT USED
AUX3: NOT USED
BEOS: USED in:
  acconfig.h:#if BEOS && !HAVE_BONE_VERSION
  acconfig.h:#define BEOS_R5 1
  acconfig.h:#define BEOS_BONE 1
  file_io/unix/dir.c:#if !defined(BEOS) && defined(DT_SOCK)
  file_io/unix/filestat.c:#if !defined(BEOS) && defined(S_IFSOCK)
  file_io/unix/filestat.c:#if !defined(BEOS) && !defined(S_IFSOCK) && 
defined(S_ISSOCK)
  file_io/unix/pipe.c:#if BEOS
...etc etc
BONE7: USED in:
  file_io/unix/pipe.c: * Basically, BONE7 changed things again so that ioctl 
didn't work,
  file_io/unix/pipe.c:#if !BONE7
  include/arch/unix/apr_arch_file_io.h:# ifndef BONE7
CONVEXOS11: NOT USED
CYGWIN: NOT USED
DARWIN: USED in:
  include/apr_portable.h:#elif defined(DARWIN)
  include/apr_signal.h:#if defined(DARWIN) && !defined(__cplusplus) && 
!defined(_ANSI_SOURCE)
  test/testatomic.c:#if !(defined BEOS) && !(defined WIN32) && !(defined 
NETWARE) && !(defined __MVS__) && !(defined DARWIN)
  test/testdso.c:#elif defined(DARWIN)
  threadproc/unix/signals.c:#ifdef DARWIN
  threadproc/unix/signals.c:#endif /* DARWIN */
  threadproc/unix/signals.c:#ifdef DARWIN
DGUX: USED in:
  include/apr_network_io.h:#elif APR_HAVE_INET_NETWORK        /* only DGUX, as 
far as I know */
ENCORE: NOT USED
HAS_DLFCN: NOT USED
HIUX: NOT USED
HPUX: USED in:
  include/apr_portable.h:#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
HPUX11: USED in:
  include/apr_portable.h:#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
HURD: NOT USED
ISC: NOT USED
LINUX: USED in:
  include/apr_general.h:#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
LYNXOS: NOT USED
MINT: NOT USED
MPE: USED in:
  passwd/apr_getpass.c:/* MPE, Win32, NetWare and BeOS all lack a native 
getpass() */
  passwd/apr_getpass.c: * MPE lacks getpass() and a way to suppress stdin echo. 
 So for now, just
  threadproc/netware/procsup.c:#if !defined(MPE) && !defined(OS2) && 
!defined(TPF) && !defined(BEOS)
  threadproc/netware/procsup.c:/* Don't detach for MPE because child processes 
can't survive the death of
  threadproc/netware/procsup.c:#elif defined(MPE)
  threadproc/netware/procsup.c:    /* MPE uses negative pid for process group */
  threadproc/unix/procsup.c:#if !defined(MPE) && !defined(OS2) && !defined(TPF) 
&& !defined(BEOS)
  threadproc/unix/procsup.c:    /* Don't detach for MPE because child processes 
can't survive the death of
  threadproc/unix/procsup.c:#elif defined(OS2) || defined(TPF) || defined(MPE)
MPRAS: NOT USED
NETBSD: NOT USED
NEWSOS: USED in:
  threadproc/netware/procsup.c:#elif defined(NEXT) || defined(NEWSOS)
  threadproc/unix/procsup.c:#elif defined(NEXT) || defined(NEWSOS)
NEXT: USED in:
  include/apr.h:    defined(NEXT)
  threadproc/netware/procsup.c:#elif defined(NEXT) || defined(NEWSOS)
  threadproc/unix/procsup.c:#elif defined(NEXT) || defined(NEWSOS)
NO_LONG_DOUBLE: NOT USED
OSF1: USED in:
  dso/unix/dso.c:#if defined(OSF1) || defined(SEQUENT) || defined(SNI) ||\
  network_io/unix/sendrecv.c:#endif /* __linux__, __FreeBSD__, __HPUX__, _AIX, 
__MVS__, Tru64/OSF1 */
PARAGON: NOT USED
PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR: USED in:
  threadproc/unix/thread.c:#ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR
PTHREAD_DETACH_ARG1_ADDR: USED in:
  threadproc/unix/thread.c:#ifdef PTHREAD_DETACH_ARG1_ADDR
PTHREAD_SETS_ERRNO: USED in:
  locks/unix/proc_mutex.c:#ifdef PTHREAD_SETS_ERRNO
...etc etc
QNX: NOT USED
RHAPSODY: NOT USED
RISCIX: NOT USED
SCO: NOT USED
SCO5: NOT USED
SEQUENT: USED in:
  dso/unix/dso.c:#if defined(OSF1) || defined(SEQUENT) || defined(SNI) ||\
  dso/unix/dso.c:#elif defined(SEQUENT) || defined(SNI)
SIGPROCMASK_SETS_THREAD_MASK: USED in:
  threadproc/unix/signals.c:#if defined(SIGPROCMASK_SETS_THREAD_MASK)
SOLARIS2: NOT USED
SUNOS4: USED in:
  include/apr_mmap.h:#  ifdef SUNOS4
  include/apr_mmap.h:#  endif /* SUNOS4 */
SVR4: USED in:
  file_io/unix/mktemp.c:#if defined(SVR4) || defined(WIN32) || defined(NETWARE)
  file_io/unix/mktemp.c:#ifdef SVR4
  strings/apr_cpystrn.c:/* The following two routines were donated for SVR4 by 
Andreas Vogel */
TCP_NODELAY: USED in:
...many places
TPF: USED in:
  threadproc/netware/procsup.c:#if !defined(MPE) && !defined(OS2) && 
!defined(TPF) && !defined(BEOS)
  threadproc/netware/procsup.c:#elif defined(OS2) || defined(TPF)
  threadproc/unix/procsup.c:#if !defined(MPE) && !defined(OS2) && !defined(TPF) 
&& !defined(BEOS)
  threadproc/unix/procsup.c:#elif defined(OS2) || defined(TPF) || defined(MPE)
ULTRIX: NOT USED
USE_MMAP_FILES: NOT USED
USE_SYSVSEM_SERIALIZED_ACCEPT: NOT USED
UTS21: NOT USED
UW: NOT USED
UXPDS: NOT USED

Reply via email to