Skip to content

Commit a2bdf92

Browse files
author
monty@butch.
committed
Portability fixes for Fortre C++ 5.0 (on Sun) in 32 and 64 bit modes.
1 parent 5333cfb commit a2bdf92

60 files changed

Lines changed: 486 additions & 425 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BUILD/compile-solaris-sparc-forte

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#! /bin/sh
2+
3+
gmake -k clean || true
4+
/bin/rm -f */.deps/*.P config.cache
5+
6+
aclocal && autoheader && aclocal && automake && autoconf
7+
(cd bdb/dist && sh s_all)
8+
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
9+
if [ -d gemini ]
10+
then
11+
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
12+
fi
13+
14+
15+
# Assume Forte is installed in /opt/SUNWSpro
16+
17+
PATH=/opt/SUNWspro/bin/:$PATH
18+
19+
# For "optimal" code for this computer add -fast to EXTRA
20+
# To compile 64 bit, add -xarch=v9 to EXTRA_64_BIT
21+
22+
EXTRA_64_BIT="-xarch=v9" # Remove comment to get 64 bit binaries
23+
EXTRA="-fast" # Remove comment to target current machine
24+
25+
#
26+
# The following should not need to be touched
27+
#
28+
29+
STD="-mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
30+
ASFLAGS="$EXTRA_64_BIT" \
31+
CC=cc-5.0 CFLAGS="-Xa -xstrconst $STD" \
32+
CXX=CC CXXFLAGS="-noex $STD" \
33+
./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
34+
35+
gmake -j 4
36+
if [ $? = 0 ]
37+
then
38+
make test
39+
fi

BUILD/compile-solaris-sparc-fortre

Lines changed: 0 additions & 19 deletions
This file was deleted.

BitKeeper/etc/logging_ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ [email protected]
4040
miguel@light.
4141
4242
43+
monty@butch.
4344
4445
4546

client/mysqlbinlog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static void dump_remote_file(NET* net, const char* fname)
176176
}
177177

178178

179-
static my_bool
179+
extern "C" static my_bool
180180
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
181181
char *argument)
182182
{

configure.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ case $MACHINE_TYPE in
7272
esac
7373

7474
# Save some variables and the command line options for mysqlbug
75+
SAVE_ASFLAGS="$ASFLAGS"
7576
SAVE_CFLAGS="$CFLAGS"
7677
SAVE_CXXFLAGS="$CXXFLAGS"
7778
SAVE_LDFLAGS="$LDFLAGS"
7879
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
7980
CONF_COMMAND="$0 $ac_configure_args"
8081
AC_SUBST(CONF_COMMAND)
82+
AC_SUBST(SAVE_ASFLAGS)
8183
AC_SUBST(SAVE_CFLAGS)
8284
AC_SUBST(SAVE_CXXFLAGS)
8385
AC_SUBST(SAVE_LDFLAGS)
@@ -602,8 +604,9 @@ AC_ARG_ENABLE(assembler,
602604
AC_MSG_CHECKING(if we should use assembler functions)
603605
# For now we only support assembler on i386 and sparc systems
604606
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386")
605-
AM_CONDITIONAL(ASSEMBLER_sparc, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
606-
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc_TRUE" = "")
607+
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
608+
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
609+
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
607610

608611
if test "$ASSEMBLER_TRUE" = ""
609612
then

include/my_global.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
#define HAVE_ERRNO_AS_DEFINE
3939
#endif /* __CYGWIN__ */
4040

41+
/* Macros to make switching between C and C++ mode easier */
42+
#ifdef __cplusplus
43+
#define C_MODE_START extern "C" {
44+
#define C_MODE_END }
45+
#else
46+
#define C_MODE_START
47+
#define C_MODE_END
48+
#endif
4149

4250
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
4351
#include <config-win.h>
@@ -121,13 +129,9 @@
121129
/* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */
122130
#define ulonglong2double(A) my_ulonglong2double(A)
123131
#define my_off_t2double(A) my_ulonglong2double(A)
124-
#ifdef __cplusplus
125-
extern "C" {
126-
#endif
132+
C_MODE_START
127133
double my_ulonglong2double(unsigned long long A);
128-
#ifdef __cplusplus
129-
}
130-
#endif
134+
C_MODE_END
131135
#endif /* _AIX */
132136

133137
#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */
@@ -385,7 +389,9 @@ typedef int my_socket; /* File descriptor for sockets */
385389
#endif
386390
/* Type for fuctions that handles signals */
387391
#define sig_handler RETSIGTYPE
392+
C_MODE_START
388393
typedef void (*sig_return)();/* Returns type from signal */
394+
C_MODE_END
389395
#if defined(__GNUC__) && !defined(_lint)
390396
typedef char pchar; /* Mixed prototypes can take char */
391397
typedef char puchar; /* Mixed prototypes can take char */
@@ -399,8 +405,10 @@ typedef int pbool; /* Mixed prototypes can't take char */
399405
typedef int pshort; /* Mixed prototypes can't take short int */
400406
typedef double pfloat; /* Mixed prototypes can't take float */
401407
#endif
408+
C_MODE_START
402409
typedef int (*qsort_cmp)(const void *,const void *);
403410
typedef int (*qsort_cmp2)(void*, const void *,const void *);
411+
C_MODE_END
404412
#ifdef HAVE_mit_thread
405413
#define qsort_t void
406414
#undef QSORT_TYPE_IS_VOID
@@ -1038,13 +1046,4 @@ typedef union {
10381046
#define statistic_add(V,C,L) (V)+=(C)
10391047
#endif
10401048

1041-
/* Macros to make switching between C and C++ mode easier */
1042-
#ifdef __cplusplus
1043-
#define C_MODE_START extern "C" {
1044-
#define C_MODE_END }
1045-
#else
1046-
#define C_MODE_START
1047-
#define C_MODE_END
1048-
#endif
1049-
1050-
#endif /* _global_h */
1049+
#endif /* my_global_h */

include/myisam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ extern uint mi_get_pointer_length(ulonglong file_length, uint def);
296296
#define T_VERBOSE (1L << 28)
297297
#define T_VERY_SILENT (1L << 29)
298298
#define T_WAIT_FOREVER (1L << 30)
299-
#define T_WRITE_LOOP (1L << 31)
299+
#define T_WRITE_LOOP ((ulong) 1L << 31)
300300

301301
#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL)
302302

include/queues.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ typedef struct st_queue {
4141
#define queue_element(queue,index) ((queue)->root[index+1])
4242
#define queue_end(queue) ((queue)->root[(queue)->elements])
4343
#define queue_replaced(queue) _downheap(queue,1)
44+
typedef int (*queue_compare)(void *,byte *, byte *);
4445

4546
int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
46-
pbool max_at_top, int (*compare)(void *,byte *, byte *),
47+
pbool max_at_top, queue_compare compare,
4748
void *first_cmp_arg);
4849
int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key,
49-
pbool max_at_top, int (*compare)(void *,byte *, byte *),
50+
pbool max_at_top, queue_compare compare,
5051
void *first_cmp_arg);
5152
void delete_queue(QUEUE *queue);
5253
void queue_insert(QUEUE *queue,byte *element);

innobase/include/ut0ut.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Created 1/20/1994 Heikki Tuuri
1010
#define ut0ut_h
1111

1212
#include "univ.i"
13+
#include <string.h>
1314
#include <time.h>
1415
#ifndef MYSQL_SERVER
1516
#include <ctype.h>

innobase/log/log0log.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,8 +1654,8 @@ log_reset_first_header_and_checkpoint(
16541654
lsn = ut_dulint_add(start, LOG_BLOCK_HDR_SIZE);
16551655

16561656
/* Write the label of ibbackup --restore */
1657-
sprintf(hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, "ibbackup ");
1658-
ut_sprintf_timestamp(hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP
1657+
sprintf((char*) hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, "ibbackup ");
1658+
ut_sprintf_timestamp((char*) hdr_buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP
16591659
+ strlen("ibbackup "));
16601660
buf = hdr_buf + LOG_CHECKPOINT_1;
16611661

0 commit comments

Comments
 (0)