Skip to content

Commit 491dc12

Browse files
author
Michael Meskes
committed
- Argh, just another bug in adjust_informix.
- Added "extern C" flags for C++ compiler. Hopefully I got that one right.
1 parent b071a40 commit 491dc12

File tree

7 files changed

+52
-3
lines changed

7 files changed

+52
-3
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,11 @@ Fri May 7 15:34:05 CEST 2004
17901790
- Added portability file to pgtypeslib.
17911791
- Fixed bug that reversed string length in typedefs.
17921792
- Added additional test case.
1793+
1794+
Mon May 10 15:38:58 CEST 2004
1795+
1796+
- Argh, just another bug in adjust_informix.
1797+
- Added "extern C" flags for C++ compiler.
17931798
- Set pgtypes library version to 1.2.
17941799
- Set ecpg version to 3.2.0.
17951800
- Set compat library version to 1.2.

src/interfaces/ecpg/include/ecpg_informix.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file contains stuff needed to be as compatible to Informix as possible.
33
*
4-
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpg_informix.h,v 1.14 2003/12/18 18:55:09 petere Exp $
4+
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpg_informix.h,v 1.15 2004/05/10 13:46:06 meskes Exp $
55
*/
66
#ifndef _ECPG_INFORMIX_H
77
#define _ECPG_INFORMIX_H
@@ -29,6 +29,11 @@
2929
#define ECPG_INFORMIX_BAD_DATE -1218
3030
#define ECPG_INFORMIX_EXTRA_CHARS -1264
3131

32+
#ifdef __cplusplus
33+
extern "C"
34+
{
35+
#endif
36+
3237
extern int rdatestr(date, char *);
3338
extern void rtoday(date *);
3439
extern int rjulmdy(date, short *);
@@ -78,4 +83,8 @@ extern int dttofmtasc(timestamp *, char *, int, char *);
7883
extern int intoasc(interval *, char *);
7984
extern int dtcvfmtasc(char *, char *, timestamp *);
8085

86+
#ifdef __cplusplus
87+
}
88+
#endif
89+
8190
#endif /* ndef _ECPG_INFORMIX_H */

src/interfaces/ecpg/include/pgtypes_date.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#include <pgtypes_timestamp.h>
55

66
typedef long date;
7+
#ifdef __cplusplus
8+
extern "C"
9+
{
10+
#endif
711

812
extern date PGTYPESdate_from_asc(char *, char **);
913
extern char *PGTYPESdate_to_asc(date);
@@ -15,4 +19,8 @@ extern void PGTYPESdate_today(date *);
1519
extern int PGTYPESdate_defmt_asc(date *, char *, char *);
1620
extern int PGTYPESdate_fmt_asc(date, char *, char *);
1721

22+
#ifdef __cplusplus
23+
}
24+
#endif
25+
1826
#endif /* PGTYPES_DATETIME */

src/interfaces/ecpg/include/pgtypes_interval.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,17 @@ typedef struct
1414
* alignment */
1515
} interval;
1616

17+
#ifdef __cplusplus
18+
extern "C"
19+
{
20+
#endif
21+
1722
extern interval *PGTYPESinterval_from_asc(char *, char **);
1823
extern char *PGTYPESinterval_to_asc(interval *);
1924
extern int PGTYPESinterval_copy(interval *, interval *);
2025

26+
#ifdef __cplusplus
27+
}
28+
#endif
29+
2130
#endif /* PGTYPES_INTERVAL */

src/interfaces/ecpg/include/pgtypes_numeric.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ typedef struct
3737
NumericDigit digits[DECSIZE]; /* decimal digits */
3838
} decimal;
3939

40+
#ifdef __cplusplus
41+
extern "C"
42+
{
43+
#endif
44+
4045
numeric *PGTYPESnumeric_new(void);
4146
void PGTYPESnumeric_free(numeric *);
4247
numeric *PGTYPESnumeric_from_asc(char *, char **);
@@ -56,4 +61,8 @@ int PGTYPESnumeric_to_long(numeric *, long *);
5661
int PGTYPESnumeric_to_decimal(numeric *, decimal *);
5762
int PGTYPESnumeric_from_decimal(decimal *, numeric *);
5863

64+
#ifdef __cplusplus
65+
}
66+
#endif
67+
5968
#endif /* PGTYPES_NUMERIC */

src/interfaces/ecpg/include/pgtypes_timestamp.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@ typedef double timestamp;
1212
typedef double TimestampTz;
1313
#endif
1414

15+
#ifdef __cplusplus
16+
extern "C"
17+
{
18+
#endif
19+
1520
extern timestamp PGTYPEStimestamp_from_asc(char *, char **);
1621
extern char *PGTYPEStimestamp_to_asc(timestamp);
1722
extern int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *);
1823
extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, char *);
1924
extern void PGTYPEStimestamp_current(timestamp *);
2025
extern int PGTYPEStimestamp_defmt_asc(char *, char *, timestamp *);
2126

27+
#ifdef __cplusplus
28+
}
29+
#endif
30+
2231
#endif /* PGTYPES_TIMESTAMP */

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.281 2004/05/07 13:42:49 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.282 2004/05/10 13:46:06 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -209,7 +209,7 @@ adjust_informix(struct arguments *list)
209209
original_var = ptr->variable->name;
210210
sprintf(temp, "%d))", ecpg_informix_var);
211211

212-
if (atoi(ptr->variable->type->size) > 1)
212+
if ((ptr->variable->type->type != ECPGt_char && ptr->variable->type->type != ECPGt_unsigned_char) && atoi(ptr->variable->type->size) > 1)
213213
{
214214
ptr->variable = new_variable(cat_str(4, make_str("("), mm_strdup(ECPGtype_name(ptr->variable->type->u.element->type)), make_str(" *)(ECPG_informix_get_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type, make_str("1")), ptr->variable->type->size), 0);
215215
sprintf(temp, "%d, (", ecpg_informix_var++);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy