Merge lp:~stewart/dbd-drizzle/fixup-for-modern-perl into lp:dbd-drizzle

Proposed by Stewart Smith
Status: Needs review
Proposed branch: lp:~stewart/dbd-drizzle/fixup-for-modern-perl
Merge into: lp:dbd-drizzle
Diff against target: 128 lines (+23/-10)
4 files modified
ChangeLog (+4/-0)
constants.h (+1/-1)
dbdimp.c (+17/-8)
drizzle.xs (+1/-1)
To merge this branch: bzr merge lp:~stewart/dbd-drizzle/fixup-for-modern-perl
Reviewer Review Type Date Requested Status
CaptTofu (community) approval Approve
Drizzle Trunk Pending
Review via email: mp+154577@code.launchpad.net

Description of the change

now builds for me with this

To post a comment you must log in.
Revision history for this message
CaptTofu (capttofu) wrote :

Looks good to me!

review: Approve (approval)
Revision history for this message
Brian Aker (brianaker) wrote :
Download full text (4.3 KiB)

Go for it.

On Mar 20, 2013, at 7:47 PM, Stewart Smith <email address hidden> wrote:

> Stewart Smith has proposed merging lp:~stewart/dbd-drizzle/fixup-for-modern-perl into lp:dbd-drizzle.
>
> Requested reviews:
> Drizzle Trunk (drizzle-trunk)
>
> For more details, see:
> https://code.launchpad.net/~stewart/dbd-drizzle/fixup-for-modern-perl/+merge/154577
>
> now builds for me with this
> --
> https://code.launchpad.net/~stewart/dbd-drizzle/fixup-for-modern-perl/+merge/154577
> Your team Drizzle Trunk is requested to review the proposed merge of lp:~stewart/dbd-drizzle/fixup-for-modern-perl into lp:dbd-drizzle.
> === modified file 'ChangeLog'
> --- ChangeLog 2012-05-02 09:53:07 +0000
> +++ ChangeLog 2013-03-21 02:46:22 +0000
> @@ -1,3 +1,7 @@
> +2013-03-20 Stewart Smith <email address hidden> (0.305)
> +* Fixed up code to build with more modern perl (sv_yes now PL_sv_yes etc)
> +* Fixed up some #include to point to libdrizzle-1.0 (modern libdrizzle)
> +
> 2011-12-01 Patrick Galbraith <email address hidden> (0.305)
> * Fixed Makefile.PL to conform to changes in libdrizzle directory structure
> * Fixed Makefile.PL to assume 'root' user if not defined
>
> === modified file 'constants.h'
> --- constants.h 2012-05-02 09:53:07 +0000
> +++ constants.h 2013-03-21 02:46:22 +0000
> @@ -2,7 +2,7 @@
> #include "perl.h"
> #include "XSUB.h"
>
> -#include <libdrizzle/drizzle_client.h>
> +#include <libdrizzle-1.0/drizzle_client.h>
>
> static double drizzle_constant(char* name, char* arg) {
> errno = 0;
>
> === modified file 'dbdimp.c'
> --- dbdimp.c 2012-05-02 09:53:07 +0000
> +++ dbdimp.c 2013-03-21 02:46:22 +0000
> @@ -19,6 +19,15 @@
> typedef short WORD;
> #endif
>
> +/* Keep compatibility with older perl */
> +#ifndef PL_sv_yes
> +#define PL_sv_yes sv_yes
> +#endif
> +#ifndef PL_sv_undef
> +#define PL_sv_undef sv_undef
> +#endif
> +
> +
> DBISTATE_DECLARE;
>
> typedef struct sql_type_info_s
> @@ -896,7 +905,7 @@
> {
> SV* sv = DBIc_IMP_DATA(imp_dbh);
>
> - DBIc_set(imp_dbh, DBIcf_AutoCommit, &sv_yes);
> + DBIc_set(imp_dbh, DBIcf_AutoCommit, &PL_sv_yes);
> if (sv && SvROK(sv))
> {
> HV* hv = (HV*) SvRV(sv);
> @@ -1333,7 +1342,7 @@
> D_imp_xxh(drh);
>
> /* The disconnect_all concept is flawed and needs more work */
> - if (!dirty && !SvTRUE(perl_get_sv("DBI::PERL_ENDING",0))) {
> + if (!PL_dirty && !SvTRUE(perl_get_sv("DBI::PERL_ENDING",0))) {
> sv_setiv(DBIc_ERR(imp_drh), (IV)1);
> sv_setpv(DBIc_ERRSTR(imp_drh),
> (char*)"disconnect_all not implemented");
> @@ -1341,7 +1350,7 @@
> DBIc_ERR(imp_drh), DBIc_ERRSTR(imp_drh)); */
> return FALSE;
> }
> - perl_destruct_level = 0;
> + PL_perl_destruct_level = 0;
> return FALSE;
> }
>
> @@ -1576,7 +1585,7 @@
> {
> const char* version = drizzle_con_server_version(imp_dbh->con);
> result= version ?
> - sv_2mortal(newSVpv(version, strlen(version))) : &sv_undef;
> + sv_2mortal(newSVpv(version, strlen(version))) : &PL_sv_undef;
> }
> else if (strEQ(key, "sock"))
> result= sv_2mortal(newSViv((IV) imp_dbh->con));
> @@ -2562,7 +2571,7 @@
> break;
>
> default:
> - sv= &sv...

Read more...

Unmerged revisions

44. By Stewart Smith

fix up building with more modern perl

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2012-05-02 09:53:07 +0000
3+++ ChangeLog 2013-03-21 02:46:22 +0000
4@@ -1,3 +1,7 @@
5+2013-03-20 Stewart Smith <stewart@flamingspork.com> (0.305)
6+* Fixed up code to build with more modern perl (sv_yes now PL_sv_yes etc)
7+* Fixed up some #include to point to libdrizzle-1.0 (modern libdrizzle)
8+
9 2011-12-01 Patrick Galbraith <patg@patg.net> (0.305)
10 * Fixed Makefile.PL to conform to changes in libdrizzle directory structure
11 * Fixed Makefile.PL to assume 'root' user if not defined
12
13=== modified file 'constants.h'
14--- constants.h 2012-05-02 09:53:07 +0000
15+++ constants.h 2013-03-21 02:46:22 +0000
16@@ -2,7 +2,7 @@
17 #include "perl.h"
18 #include "XSUB.h"
19
20-#include <libdrizzle/drizzle_client.h>
21+#include <libdrizzle-1.0/drizzle_client.h>
22
23 static double drizzle_constant(char* name, char* arg) {
24 errno = 0;
25
26=== modified file 'dbdimp.c'
27--- dbdimp.c 2012-05-02 09:53:07 +0000
28+++ dbdimp.c 2013-03-21 02:46:22 +0000
29@@ -19,6 +19,15 @@
30 typedef short WORD;
31 #endif
32
33+/* Keep compatibility with older perl */
34+#ifndef PL_sv_yes
35+#define PL_sv_yes sv_yes
36+#endif
37+#ifndef PL_sv_undef
38+#define PL_sv_undef sv_undef
39+#endif
40+
41+
42 DBISTATE_DECLARE;
43
44 typedef struct sql_type_info_s
45@@ -896,7 +905,7 @@
46 {
47 SV* sv = DBIc_IMP_DATA(imp_dbh);
48
49- DBIc_set(imp_dbh, DBIcf_AutoCommit, &sv_yes);
50+ DBIc_set(imp_dbh, DBIcf_AutoCommit, &PL_sv_yes);
51 if (sv && SvROK(sv))
52 {
53 HV* hv = (HV*) SvRV(sv);
54@@ -1333,7 +1342,7 @@
55 D_imp_xxh(drh);
56
57 /* The disconnect_all concept is flawed and needs more work */
58- if (!dirty && !SvTRUE(perl_get_sv("DBI::PERL_ENDING",0))) {
59+ if (!PL_dirty && !SvTRUE(perl_get_sv("DBI::PERL_ENDING",0))) {
60 sv_setiv(DBIc_ERR(imp_drh), (IV)1);
61 sv_setpv(DBIc_ERRSTR(imp_drh),
62 (char*)"disconnect_all not implemented");
63@@ -1341,7 +1350,7 @@
64 DBIc_ERR(imp_drh), DBIc_ERRSTR(imp_drh)); */
65 return FALSE;
66 }
67- perl_destruct_level = 0;
68+ PL_perl_destruct_level = 0;
69 return FALSE;
70 }
71
72@@ -1576,7 +1585,7 @@
73 {
74 const char* version = drizzle_con_server_version(imp_dbh->con);
75 result= version ?
76- sv_2mortal(newSVpv(version, strlen(version))) : &sv_undef;
77+ sv_2mortal(newSVpv(version, strlen(version))) : &PL_sv_undef;
78 }
79 else if (strEQ(key, "sock"))
80 result= sv_2mortal(newSViv((IV) imp_dbh->con));
81@@ -2562,7 +2571,7 @@
82 break;
83
84 default:
85- sv= &sv_undef;
86+ sv= &PL_sv_undef;
87 break;
88 }
89 av_push(av, sv);
90@@ -2576,7 +2585,7 @@
91 }
92
93 if (av == Nullav)
94- return &sv_undef;
95+ return &PL_sv_undef;
96
97 return sv_2mortal(newRV_inc((SV*)av));
98 }
99@@ -2927,7 +2936,7 @@
100 sv= newSVpv((char*) (c), 0); \
101 SvREADONLY_on(sv); \
102 } else { \
103- sv= &sv_undef; \
104+ sv= &PL_sv_undef; \
105 } \
106 av_push(row, sv);
107
108@@ -3004,7 +3013,7 @@
109 IV_PUSH(t->num_prec_radix);
110 }
111 else
112- av_push(row, &sv_undef);
113+ av_push(row, &PL_sv_undef);
114
115 IV_PUSH(t->sql_datatype); /* SQL_DATATYPE*/
116 IV_PUSH(t->sql_datetime_sub); /* SQL_DATETIME_SUB*/
117
118=== modified file 'drizzle.xs'
119--- drizzle.xs 2012-05-02 09:53:07 +0000
120+++ drizzle.xs 2013-03-21 02:46:22 +0000
121@@ -10,7 +10,7 @@
122 */
123
124 #include <stdlib.h>
125-#include <libdrizzle/drizzle_client.h>
126+#include <libdrizzle-1.0/drizzle_client.h>
127 #include "dbdimp.h"
128 #include "constants.h"
129

Subscribers

People subscribed via source and target branches

to all changes: