You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2015/10/03 08:38:05 UTC

[Bug 58476] New: include for stdint.h missing in apr_dbd_odbc.c

https://bz.apache.org/bugzilla/show_bug.cgi?id=58476

            Bug ID: 58476
           Summary: include for stdint.h missing in apr_dbd_odbc.c
           Product: APR
           Version: HEAD
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR-util
          Assignee: bugs@apr.apache.org
          Reporter: tschoening@am-soft.de

Im building apr-util with Embarcadero C++-Builder 10 Seattle and run into
compile time problems in apr_dbd_odbc.c, which uses the following line:

> #define   ODBC_INTPTR_T  intptr_t

intptr_t is part of stdint.h, which is available, but doesn't seem to be
included, therefore intptr_t is not defined. In APR itself apr.h contains
APR_HAVE_STDINT_H, which was 0 by default in apr.hw, but even if I change it to
1 that doesn't change anything, because apr.hw doesn't include stdint.h on it's
own, instead of apr.h.in, which does. If I add such an include on my own, the
error about missing intptr_t is gone and I think it makes sense to add it in
apr.hw, because it already checks and includes other things.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 58476] include for stdint.h missing in apr_dbd_odbc.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58476

--- Comment #2 from Jeff Trawick <tr...@apache.org> ---
Older MSVC doesn't have <stdint.h>, hence the historic setting of
APR_HAVE_STDINT_H to 0 and not conditionally including it.

One potential long term solution is to update the cmake build of apr to check
for stdint.h and define the symbol to 1 and include it in apr.hwc ("c" for
"cmake") when present (matching apr.h on Unix).

Have you tried any cmake projects with Embarcadero C++-Builder 10?  I'm not
sure if cmake supports that.  Even if so, the apr cmake build would likely need
tweaks here and there to remove MSVC-isms, but that's probably not too hard.

Other devs may know an appropriate way to update the MSVC makefiles/project
files to handle this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 58476] include for stdint.h missing in apr_dbd_odbc.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58476

--- Comment #1 from Thorsten Schöning <ts...@am-soft.de> ---
Created attachment 33157
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33157&action=edit
apr.hw.patch

Index: apr.hw
===================================================================
--- apr.hw    (Revision 4145)
+++ apr.hw    (Arbeitskopie)
@@ -25,7 +25,7 @@
  * And please, make an effort to stub apr.hnw and apr.h.in in the process.
  *
  * This is the Win32 specific version of apr.h.  It is copied from
- * apr.hw by the apr.dsp and libapr.dsp projects. 
+ * apr.hw by the apr.dsp and libapr.dsp projects.
  */

 /**
@@ -32,7 +32,7 @@
  * @file apr.h
  * @brief APR Platform Definitions
  * @remark This is a generated header generated from include/apr.h.in by
- * ./configure, or copied from include/apr.hw or include/apr.hnw 
+ * ./configure, or copied from include/apr.hw or include/apr.hnw
  * for Win32 or Netware by those build environments, respectively.
  */

@@ -96,7 +96,7 @@
 #define NOIME
 #endif
 #include <windows.h>
-/* 
+/*
  * Add a _very_few_ declarations missing from the restricted set of headers
  * (If this list becomes extensive, re-enable the required headers above!)
  * winsock headers were excluded by WIN32_LEAN_AND_MEAN, so include them now
@@ -148,7 +148,7 @@
 #define APR_HAVE_SEMAPHORE_H    0
 #define APR_HAVE_SIGNAL_H       1
 #define APR_HAVE_STDARG_H       1
-#define APR_HAVE_STDINT_H       0
+#define APR_HAVE_STDINT_H       1
 #define APR_HAVE_STDIO_H        1
 #define APR_HAVE_STDLIB_H       1
 #define APR_HAVE_STRING_H       1
@@ -212,8 +212,8 @@
 /** @} */
 /** @} */

-/* We don't include our conditional headers within the doxyblocks 
- * or the extern "C" namespace 
+/* We don't include our conditional headers within the doxyblocks
+ * or the extern "C" namespace
  */

 #if APR_HAVE_STDLIB_H
@@ -228,6 +228,9 @@
 #if APR_HAVE_STDDEF_H
 #include <stddef.h>
 #endif
+#if APR_HAVE_STDINT_H
+#include <stdint.h>
+#endif
 #if APR_HAVE_TIME_H
 #include <time.h>
 #endif
@@ -241,7 +244,7 @@

 /**
  * @addtogroup apr_platform
- * @ingroup APR 
+ * @ingroup APR
  * @{
  */

@@ -261,12 +264,12 @@
 #define APR_USE_SHMEM_MMAP_ANON    0
 #define APR_USE_SHMEM_BEOS         0

-#define APR_USE_FLOCK_SERIALIZE           0 
+#define APR_USE_FLOCK_SERIALIZE           0
 #define APR_USE_POSIXSEM_SERIALIZE        0
 #define APR_USE_SYSVSEM_SERIALIZE         0
 #define APR_USE_FCNTL_SERIALIZE           0
-#define APR_USE_PROC_PTHREAD_SERIALIZE    0 
-#define APR_USE_PTHREAD_SERIALIZE         0 
+#define APR_USE_PROC_PTHREAD_SERIALIZE    0
+#define APR_USE_PTHREAD_SERIALIZE         0

 #define APR_HAS_FLOCK_SERIALIZE           0
 #define APR_HAS_SYSVSEM_SERIALIZE         0
@@ -478,8 +481,8 @@
 #define APR_END_DECLS
 #endif

-/** 
- * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC, 
+/**
+ * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC,
  * so that they follow the platform's calling convention.
  * <PRE>
  *
@@ -494,7 +497,7 @@

 /**
  * The public APR functions are declared with APR_DECLARE(), so they may
- * use the most appropriate calling convention.  Public APR functions with 
+ * use the most appropriate calling convention.  Public APR functions with
  * variable arguments must use APR_DECLARE_NONSTD().
  *
  * @remark Both the declaration and implementations must use the same macro.
@@ -503,20 +506,20 @@
  * APR_DECLARE(rettype) apr_func(args)
  * </PRE>
  * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
- * @remark Note that when APR compiles the library itself, it passes the 
- * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32) 
+ * @remark Note that when APR compiles the library itself, it passes the
+ * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
  * to export public symbols from the dynamic library build.\n
  * The user must define the APR_DECLARE_STATIC when compiling to target
- * the static APR library on some platforms (e.g. Win32.)  The public symbols 
+ * the static APR library on some platforms (e.g. Win32.)  The public symbols
  * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
  * By default, compiling an application and including the APR public
  * headers, without defining APR_DECLARE_STATIC, will prepare the code to be
  * linked to the dynamic library.
  */
-#define APR_DECLARE(type)            type 
+#define APR_DECLARE(type)            type

 /**
- * The public APR functions using variable arguments are declared with 
+ * The public APR functions using variable arguments are declared with
  * APR_DECLARE_NONSTD(), as they must follow the C language calling
convention.
  * @see APR_DECLARE @see APR_DECLARE_DATA
  * @remark Both the declaration and implementations must use the same macro.
@@ -534,7 +537,7 @@
  * @see APR_DECLARE @see APR_DECLARE_NONSTD
  * @remark Note that the declaration and implementations use different forms,
  * but both must include the macro.
- * 
+ *
  * <PRE>
  *
  * extern APR_DECLARE_DATA type apr_variable;\n

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 58476] include for stdint.h missing in apr_dbd_odbc.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58476

--- Comment #3 from Thorsten Schöning <ts...@am-soft.de> ---
(In reply to Jeff Trawick from comment #2)
> Older MSVC doesn't have <stdint.h>, hence the historic setting of
> APR_HAVE_STDINT_H to 0 and not conditionally including it.

The problem with forcefully setting it to 0 is that one can't override it on
the project level, only by changing the header... So could you please at least
consider adding the conditional include of stdint.h? This shouldn't harm for
older compilers because HAVE_STDINT_H will just be 0 as it was before and users
with newer compilers would not need to change two parts of the file, but just
HAVE_STDINT_H to 1.

> Have you tried any cmake projects with Embarcadero C++-Builder 10?  I'm not
> sure if cmake supports that.

It doesn't, cmake only generates old makefiles, for which the support in
C++-Builder has been dropped years ago. It now uses MSBuild based XML files
enhanced with some custom values and such, cmake is of no help with them.

https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#makefile-generators
http://stackoverflow.com/a/22998868/2055163 point 4

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 58476] include for stdint.h missing in apr_dbd_odbc.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58476

--- Comment #4 from Jeff Trawick <tr...@apache.org> ---
>So could you please at least consider adding the conditional include of stdint.h?

I'll do that.

Perhaps there's an existing pattern in that build implementation that uses
settings to enable certain features, and this would be a natural addition.  I
don't know.  Hopefully one of the maintainers of that build support will
respond.

>point 4

Ouch/sorry.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 58476] include for stdint.h missing in apr_dbd_odbc.c

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58476

--- Comment #5 from Jeff Trawick <tr...@apache.org> ---
The sync with Unix apr.h on the include of stdint.h is now in the 1.6.x branch
(r1707712) and 1.5.x branch (r1707717).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org