You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Colin Hercus <co...@neuramatix.com> on 2003/06/02 05:41:35 UTC

Using APR with Borland C++

Hi,
 
 
I would like to use APR but we use Borland C++ I haven't been able to
build it. Does anyone have Borland project files for APR or is it
possible to get W32 .dll and .lib files
 
Thanks, Colin

Re: Using APR with Borland C++

Posted by Saxon <sa...@saxon.cx>.
Hi Colin,

I use APR with both VC6 and Borland C++ Builder 6. I started with the
automatic DSP to BPR conversion utility, and then had to make a few more
changes to get it to work properly. Some of these changes I have submitted
back to the APR list as patches, but they haven't been taken up. Here's the
list of source code changes:

****************************************************************************
*

In file_io\win32\filepath.c, changed this:

    char seperator[2] = { (flags & APR_FILEPATH_NATIVE) ? '\\' : '/', 0};
    const char *delim1;
    const char *delim2;

to this:

    char seperator[2] = {0, 0};
    const char *delim1;
    const char *delim2;

    seperator[0] = (flags & APR_FILEPATH_NATIVE) ? '\\' : '/';

This was sent to the APR dev mailing list as a patch on the 13th of May
2003.

****************************************************************************
*

In these three files:

misc\win32\internal.c
misc\win32\misc.c
misc\win32\start.c

Put #ifndef __BORLANDC__ / #endif around the #include of crtdbg.h, since
Borland's crtdbg.h is not compatible with C.

****************************************************************************
*

In misc\win32\internal.c put #ifndef __BORLANDC__ / #endif around the
apr_wastrtoastr() function, since it calls _malloc_dbg() which does not
exist in Borland.

****************************************************************************
*

In misc\win32\start.c put #ifndef __BORLANDC__ / #endif around the
warrsztoastr() and apr_app_initialize() functions, since they call
_malloc_dbg() and/or _realloc_dbg() which do not exist in Borland.

****************************************************************************
*

In include\arch\win32\apr_private.h, added this:

#if APR_HAVE_SIGNAL_H
#include <signal.h>
#endif

And changed this:

#define SIGHUP     1
/* 2 is used for SIGINT on windows */
#define SIGQUIT    3
/* 4 is used for SIGILL on windows */
#define SIGTRAP    5
#define SIGIOT     6
#define SIGBUS     7
/* 8 is used for SIGFPE on windows */
#define SIGKILL    9
#define SIGUSR1    10
/* 11 is used for SIGSEGV on windows */
#define SIGUSR2    12
#define SIGPIPE    13
#define SIGALRM    14
/* 15 is used for SIGTERM on windows */
#define SIGSTKFLT  16
#define SIGCHLD    17
#define SIGCONT    18
#define SIGSTOP    19
#define SIGTSTP    20
/* 21 is used for SIGBREAK on windows */
/* 22 is used for SIGABRT on windows */
#define SIGTTIN    23
#define SIGTTOU    24
#define SIGURG     25
#define SIGXCPU    26
#define SIGXFSZ    27
#define SIGVTALRM  28
#define SIGPROF    29
#define SIGWINCH   30
#define SIGIO      31

To this:

#define SIGHUP     1
/* 2 is used for SIGINT on windows */
#define SIGQUIT    3
/* 4 is used for SIGILL on windows */
#define SIGTRAP    5
#define SIGIOT     6
#define SIGBUS     7
/* 8 is used for SIGFPE on windows */
#define SIGKILL    9
#define SIGSTKFLT  10
/* 11 is used for SIGSEGV on windows */
#define SIGCHLD    12
#define SIGPIPE    13
#define SIGALRM    14
/* 15 is used for SIGTERM on windows */
#ifndef SIGUSR1
/* 16 is used for SIGUSR1 with Borland C++ */
#define SIGUSR1    16
#endif
#ifndef SIGUSR2
/* 17 is used for SIGUSR2 with Borland C++ */
#define SIGUSR2    17
#endif
#define SIGCONT    18
#define SIGSTOP    19
#define SIGTSTP    20
/* 21 is used for SIGBREAK on windows */
/* 22 is used for SIGABRT on windows */
#define SIGTTIN    23
#define SIGTTOU    24
#define SIGURG     25
#define SIGXCPU    26
#define SIGXFSZ    27
#define SIGVTALRM  28
#define SIGPROF    29
#define SIGWINCH   30
#define SIGIO      31

To stop warnings like this:

[C++ Warning] signal.h(65): W8017 Redefinition of 'SIGUSR1' is not identical
[C++ Warning] signal.h(66): W8017 Redefinition of 'SIGUSR2' is not identical
[C++ Warning] apr_private.h(132): W8017 Redefinition of 'SIGUSR1' is not
identical
[C++ Warning] apr_private.h(134): W8017 Redefinition of 'SIGUSR2' is not
identical

This was sent to the APR dev mailing list as a patch on the 14th of May
2003.

****************************************************************************
*

Let me know what problems you get with the project files, and I'll see if I
can help.

Saxon

----- Original Message -----
From: "Colin Hercus" <co...@neuramatix.com>
To: <de...@apr.apache.org>
Sent: Monday, June 02, 2003 11:41 AM
Subject: Using APR with Borland C++


> Hi,
>
>
> I would like to use APR but we use Borland C++ I haven't been able to
> build it. Does anyone have Borland project files for APR or is it
> possible to get W32 .dll and .lib files
>
> Thanks, Colin
>