]> git.pld-linux.org Git - packages/claws-mail.git/blob - perl-5.36.patch
perl 5.36.0 rebuild
[packages/claws-mail.git] / perl-5.36.patch
1 From 5fee50c54a370fdfb5241bd4c4c16281a741762e Mon Sep 17 00:00:00 2001
2 From: Ricardo Mones <ricardo@mones.org>
3 Date: Sat, 23 Apr 2022 19:26:16 +0200
4 Subject: [PATCH] Fix building perl plugin since perl v5.35.2
5
6 Using XSRETURN_* macros in expressions is now deprecated:
7 https://github.com/Perl/perl5/commit/7169efc77525df70484a824bff4ceebd1fafc760
8 ---
9  src/plugins/perl/perl_plugin.c | 243 +++++++++++++++++++++++++--------
10  1 file changed, 188 insertions(+), 55 deletions(-)
11
12 diff --git a/src/plugins/perl/perl_plugin.c b/src/plugins/perl/perl_plugin.c
13 index f9597b342..cc33aee57 100644
14 --- a/src/plugins/perl/perl_plugin.c
15 +++ b/src/plugins/perl/perl_plugin.c
16 @@ -577,76 +577,182 @@ static XS(XS_ClawsMail_filter_init)
17  
18      /* msginfo */
19    case  1:
20 -    msginfo->size       ? XSRETURN_UV(msginfo->size)       : XSRETURN_UNDEF;
21 +    if (msginfo->size) {
22 +      XSRETURN_UV(msginfo->size);
23 +    }
24 +    else {
25 +      XSRETURN_UNDEF;
26 +    }
27    case  2:
28 -    msginfo->date       ? XSRETURN_PV(msginfo->date)       : XSRETURN_UNDEF;
29 +    if (msginfo->date) {
30 +      XSRETURN_PV(msginfo->date);
31 +    }
32 +    else {
33 +      XSRETURN_UNDEF;
34 +    }
35    case  3:
36 -    msginfo->from       ? XSRETURN_PV(msginfo->from)       : XSRETURN_UNDEF;
37 +    if (msginfo->from) {
38 +      XSRETURN_PV(msginfo->from);
39 +    }
40 +    else {
41 +      XSRETURN_UNDEF;
42 +    }
43    case  4:
44 -    msginfo->to         ? XSRETURN_PV(msginfo->to)         : XSRETURN_UNDEF;
45 +    if (msginfo->to) {
46 +      XSRETURN_PV(msginfo->to);
47 +    }
48 +    else {
49 +      XSRETURN_UNDEF;
50 +    }
51    case  5:
52 -    msginfo->cc         ? XSRETURN_PV(msginfo->cc)         : XSRETURN_UNDEF;
53 +    if (msginfo->cc) {
54 +      XSRETURN_PV(msginfo->cc);
55 +    }
56 +    else {
57 +      XSRETURN_UNDEF;
58 +    }
59    case  6:
60 -    msginfo->newsgroups ? XSRETURN_PV(msginfo->newsgroups) : XSRETURN_UNDEF;
61 +    if (msginfo->newsgroups) {
62 +      XSRETURN_PV(msginfo->newsgroups);
63 +    }
64 +    else {
65 +      XSRETURN_UNDEF;
66 +    }
67    case  7:
68 -    msginfo->subject    ? XSRETURN_PV(msginfo->subject)    : XSRETURN_UNDEF;
69 +    if (msginfo->subject) {
70 +      XSRETURN_PV(msginfo->subject);
71 +    }
72 +    else {
73 +      XSRETURN_UNDEF;
74 +    }
75    case  8:
76 -    msginfo->msgid      ? XSRETURN_PV(msginfo->msgid)      : XSRETURN_UNDEF;
77 +    if (msginfo->msgid) {
78 +      XSRETURN_PV(msginfo->msgid);
79 +    }
80 +    else {
81 +      XSRETURN_UNDEF;
82 +    }
83    case  9:
84 -    msginfo->inreplyto  ? XSRETURN_PV(msginfo->inreplyto)  : XSRETURN_UNDEF;
85 +    if (msginfo->inreplyto) {
86 +      XSRETURN_PV(msginfo->inreplyto);
87 +    }
88 +    else {
89 +      XSRETURN_UNDEF;
90 +    }
91    case 10:
92 -    msginfo->xref       ? XSRETURN_PV(msginfo->xref)       : XSRETURN_UNDEF;
93 +    if (msginfo->xref) {
94 +      XSRETURN_PV(msginfo->xref);
95 +    }
96 +    else {
97 +      XSRETURN_UNDEF;
98 +    }
99    case 11:
100      xface = procmsg_msginfo_get_avatar(msginfo, AVATAR_XFACE);
101 -    xface               ? XSRETURN_PV(xface)               : XSRETURN_UNDEF;
102 +    if (xface) {
103 +      XSRETURN_PV(xface);
104 +    }
105 +    else {
106 +      XSRETURN_UNDEF;
107 +    }
108    case 12:
109 -    (msginfo->extradata && msginfo->extradata->dispositionnotificationto) ?
110 -      XSRETURN_PV(msginfo->extradata->dispositionnotificationto) : XSRETURN_UNDEF;
111 +    if (msginfo->extradata && msginfo->extradata->dispositionnotificationto) {
112 +      XSRETURN_PV(msginfo->extradata->dispositionnotificationto);
113 +    }
114 +    else {
115 +      XSRETURN_UNDEF;
116 +    }
117    case 13:
118 -    (msginfo->extradata && msginfo->extradata->returnreceiptto) ?
119 -      XSRETURN_PV(msginfo->extradata->returnreceiptto)     : XSRETURN_UNDEF;
120 +    if (msginfo->extradata && msginfo->extradata->returnreceiptto) {
121 +      XSRETURN_PV(msginfo->extradata->returnreceiptto);
122 +    }
123 +    else {
124 +      XSRETURN_UNDEF;
125 +    }
126    case 14:
127      EXTEND(SP, g_slist_length(msginfo->references));
128      ii = 0;
129      for(walk = msginfo->references; walk != NULL; walk = g_slist_next(walk))
130        XST_mPV(ii++,walk->data ? (gchar*) walk->data: "");
131 -    ii ? XSRETURN(ii) : XSRETURN_UNDEF;
132 +    if (ii) {
133 +      XSRETURN(ii);
134 +    }
135 +    else {
136 +      XSRETURN_UNDEF;
137 +    }
138    case 15:
139 -    msginfo->score      ? XSRETURN_IV(msginfo->score)      : XSRETURN_UNDEF;
140 +    if (msginfo->score) {
141 +      XSRETURN_IV(msginfo->score);
142 +    }
143 +    else {
144 +      XSRETURN_UNDEF;
145 +    }
146    case 17:
147 -    msginfo->plaintext_file ?
148 -      XSRETURN_PV(msginfo->plaintext_file)                 : XSRETURN_UNDEF;
149 +    if (msginfo->plaintext_file) {
150 +      XSRETURN_PV(msginfo->plaintext_file);
151 +    }
152 +    else {
153 +      XSRETURN_UNDEF;
154 +    }
155    case 19:
156 -    msginfo->hidden     ? XSRETURN_IV(msginfo->hidden)     : XSRETURN_UNDEF;
157 +    if (msginfo->hidden) {
158 +      XSRETURN_IV(msginfo->hidden);
159 +    }
160 +    else {
161 +      XSRETURN_UNDEF;
162 +    }
163    case 20:
164      if((charp = procmsg_get_message_file_path(msginfo)) != NULL) {
165        strncpy2(buf,charp,sizeof(buf));
166        g_free(charp);
167        XSRETURN_PV(buf);
168      }
169 -    else
170 +    else {
171        XSRETURN_UNDEF;
172 +    }
173    case 21:
174 -    (msginfo->extradata && msginfo->extradata->partial_recv) ?
175 -      XSRETURN_PV(msginfo->extradata->partial_recv)        : XSRETURN_UNDEF;
176 +    if (msginfo->extradata && msginfo->extradata->partial_recv)  {
177 +      XSRETURN_PV(msginfo->extradata->partial_recv);
178 +    }
179 +    else {
180 +      XSRETURN_UNDEF;
181 +    }
182    case 22:
183 -    msginfo->total_size ? XSRETURN_IV(msginfo->total_size) : XSRETURN_UNDEF;
184 +    if (msginfo->total_size) {
185 +      XSRETURN_IV(msginfo->total_size);
186 +    }
187 +    else {
188 +      XSRETURN_UNDEF;
189 +    }
190    case 23:
191 -    (msginfo->extradata && msginfo->extradata->account_server) ?
192 -      XSRETURN_PV(msginfo->extradata->account_server)      : XSRETURN_UNDEF;
193 +    if (msginfo->extradata && msginfo->extradata->account_server) {
194 +      XSRETURN_PV(msginfo->extradata->account_server);
195 +    }
196 +    else {
197 +      XSRETURN_UNDEF;
198 +    }
199    case 24:
200 -    (msginfo->extradata && msginfo->extradata->account_login) ?
201 -      XSRETURN_PV(msginfo->extradata->account_login)       : XSRETURN_UNDEF;
202 +    if (msginfo->extradata && msginfo->extradata->account_login) {
203 +      XSRETURN_PV(msginfo->extradata->account_login);
204 +    }
205 +    else {
206 +      XSRETURN_UNDEF;
207 +    }
208    case 25:
209 -    msginfo->planned_download ?
210 -      XSRETURN_IV(msginfo->planned_download)               : XSRETURN_UNDEF;
211 +    if (msginfo->planned_download) {
212 +      XSRETURN_IV(msginfo->planned_download);
213 +    }
214 +    else {
215 +      XSRETURN_UNDEF;
216 +    }
217  
218      /* general */
219    case 100:
220 -    if(manual_filtering)
221 +    if(manual_filtering) {
222        XSRETURN_YES;
223 -    else
224 +    }
225 +    else {
226        XSRETURN_NO;
227 +    }
228    default:
229      g_warning("Perl plugin: wrong argument to ClawsMail::C::init");
230      XSRETURN_UNDEF;    
231 @@ -664,8 +770,9 @@ static XS(XS_ClawsMail_open_mail_file)
232      XSRETURN_UNDEF;
233    }
234    file = procmsg_get_message_file_path(msginfo);
235 -  if(!file)
236 +  if(!file) {
237      XSRETURN_UNDEF;
238 +  }
239    if((message_file = claws_fopen(file, "rb")) == NULL) {
240      FILE_OP_ERROR(file, "claws_fopen");
241      g_warning("Perl plugin: file open error in ClawsMail::C::open_mail_file");
242 @@ -718,8 +825,9 @@ static XS(XS_ClawsMail_get_next_header)
243      g_free(buf);
244      XSRETURN(2);
245    }
246 -  else
247 +  else {
248      XSRETURN_EMPTY;
249 +  }
250  }
251  
252  /* ClawsMail::C::get_next_body_line */
253 @@ -736,10 +844,12 @@ static XS(XS_ClawsMail_get_next_body_line)
254      g_warning("Perl plugin: message file not open. Use ClawsMail::C::open_message_file first");
255      XSRETURN_UNDEF;
256    }
257 -  if(claws_fgets(buf, sizeof(buf), message_file) != NULL)
258 +  if(claws_fgets(buf, sizeof(buf), message_file) != NULL) {
259      XSRETURN_PV(buf);
260 -  else
261 +  }
262 +  else {
263      XSRETURN_UNDEF;
264 +  }
265  }
266  
267  
268 @@ -772,57 +882,65 @@ static XS(XS_ClawsMail_check_flag)
269        filter_log_write(LOG_MATCH,"marked");
270        XSRETURN_YES;
271      }
272 -    else
273 +    else {
274        XSRETURN_NO;
275 +    }
276    case 2:
277      if(MSG_IS_UNREAD(msginfo->flags)) {
278        filter_log_write(LOG_MATCH,"unread");
279        XSRETURN_YES;
280      }
281 -    else
282 +    else {
283        XSRETURN_NO;
284 +    }
285    case 3:
286      if(MSG_IS_DELETED(msginfo->flags)) {
287        filter_log_write(LOG_MATCH,"deleted");
288        XSRETURN_YES;
289      }
290 -    else
291 +    else {
292        XSRETURN_NO;
293 +    }
294    case 4:
295      if(MSG_IS_NEW(msginfo->flags)) {
296        filter_log_write(LOG_MATCH,"new");
297        XSRETURN_YES;
298      }
299 -    else
300 +    else {
301        XSRETURN_NO;
302 +    }
303    case 5:
304      if(MSG_IS_REPLIED(msginfo->flags)) {
305        filter_log_write(LOG_MATCH,"replied");
306        XSRETURN_YES;
307      }
308 -    else
309 +    else {
310        XSRETURN_NO;
311 +    }
312    case 6:
313      if(MSG_IS_FORWARDED(msginfo->flags)) {
314        filter_log_write(LOG_MATCH,"forwarded");
315        XSRETURN_YES;
316      }
317 -    else
318 +    else {
319        XSRETURN_NO;
320 +    }
321    case 7:
322      if(MSG_IS_LOCKED(msginfo->flags)) {
323        filter_log_write(LOG_MATCH,"locked");
324        XSRETURN_YES;
325      }
326 -    else
327 +    else {
328        XSRETURN_NO;
329 +    }
330    case 8:
331      if(MSG_IS_IGNORE_THREAD(msginfo->flags)) {
332        filter_log_write(LOG_MATCH,"ignore_thread");
333        XSRETURN_YES;
334      }
335 -    else
336 +    else {
337        XSRETURN_NO;
338 +    }
339    default:
340      g_warning("Perl plugin: unknown argument to ClawsMail::C::check_flag");
341      XSRETURN_UNDEF;
342 @@ -845,8 +963,9 @@ static XS(XS_ClawsMail_colorlabel)
343      filter_log_write(LOG_MATCH,"colorlabel");
344      XSRETURN_YES;
345    }
346 -  else
347 +  else {
348      XSRETURN_NO;
349 +  }
350  }
351  
352  /* ClawsMail::C::age_greater(int) */
353 @@ -866,8 +985,9 @@ static XS(XS_ClawsMail_age_greater)
354      filter_log_write(LOG_MATCH,"age_greater");
355      XSRETURN_YES;
356    }
357 -  else
358 +  else {
359      XSRETURN_NO;
360 +  }
361  }
362  
363  /* ClawsMail::C::age_lower(int) */
364 @@ -887,8 +1007,9 @@ static XS(XS_ClawsMail_age_lower)
365      filter_log_write(LOG_MATCH,"age_lower");
366      XSRETURN_YES;
367    }
368 -  else
369 +  else {
370      XSRETURN_NO;
371 +  }
372  }
373  
374  /* ClawsMail::C::tagged() */
375 @@ -900,7 +1021,12 @@ static XS(XS_ClawsMail_tagged)
376      XSRETURN_UNDEF;
377    }
378  
379 -  return msginfo->tags ? XSRETURN_YES : XSRETURN_NO;
380 +  if (msginfo->tags) {
381 +    XSRETURN_YES;
382 +  }
383 +  else {
384 +    XSRETURN_NO;
385 +  }
386  }
387  
388  /* ClawsMail::C::get_tags() */
389 @@ -1032,10 +1158,12 @@ static XS(XS_ClawsMail_make_sure_folder_exists)
390  
391    identifier = SvPV_nolen(ST(0));
392    item = folder_get_item_from_identifier(identifier);
393 -  if(item)
394 +  if(item) {
395      XSRETURN_YES;
396 -  else
397 +  }
398 +  else {
399      XSRETURN_NO;
400 +  }
401  }
402  
403  
404 @@ -1066,8 +1194,9 @@ static XS(XS_ClawsMail_addr_in_addressbook)
405      filter_log_write(LOG_MATCH,"addr_in_addressbook");
406      XSRETURN_YES;
407    }
408 -  else
409 +  else {
410      XSRETURN_NO;
411 +  }
412  }
413  
414  
415 @@ -1348,8 +1477,9 @@ static XS(XS_ClawsMail_forward)
416  
417      XSRETURN_YES;
418    }
419 -  else
420 +  else {
421      XSRETURN_UNDEF;
422 +  }
423  }
424  
425  /* ClawsMail::C::redirect(int,char*) */
426 @@ -1373,8 +1503,9 @@ static XS(XS_ClawsMail_redirect)
427    account = account_find_from_id(account_id);
428    compose = compose_redirect(account, msginfo, TRUE);
429    
430 -  if (compose->account->protocol == A_NNTP)
431 +  if (compose->account->protocol == A_NNTP) {
432      XSRETURN_UNDEF;
433 +  }
434    else
435      compose_entry_append(compose, dest, COMPOSE_TO, PREF_NONE);
436  
437 @@ -1389,8 +1520,9 @@ static XS(XS_ClawsMail_redirect)
438  
439      XSRETURN_YES;
440    }
441 -  else
442 +  else {
443      XSRETURN_UNDEF;
444 +  }
445  }
446  
447  
448 @@ -1472,8 +1604,9 @@ static XS(XS_ClawsMail_get_attribute_value)
449      attribute_value = get_attribute_value(addr,attr,bookname);
450    }
451  
452 -  if(attribute_value)
453 +  if(attribute_value) {
454      XSRETURN_PV(attribute_value);
455 +  }
456    XSRETURN_PV("");
457  }
458  
459 -- 
460 2.25.1
461
This page took 0.095002 seconds and 3 git commands to generate.