Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit75eae09

Browse files
committed
Change HAVE_LIBLZ4 and HAVE_LIBZSTD tests to USE_LZ4 and USE_ZSTD.
These tests were added recently, but older code tests USE_LZ4 rathrthan HAVE_LIBLZ4, so let's follow the established precedent. Italso seems more consistent with the intent of the configure tests,since I think that the USE_* symbols are intended to correspond towhat the user requested, and the HAVE_* symbols to what configurefound while probing.Discussion:http://postgr.es/m/CA+Tgmoap+hTD2-QNPJLH4tffeFE8MX5+xkbFKMU3FKBy=ZSNKA@mail.gmail.com
1 parent695f459 commit75eae09

File tree

11 files changed

+41
-41
lines changed

11 files changed

+41
-41
lines changed

‎src/backend/replication/basebackup_lz4.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
*/
1313
#include"postgres.h"
1414

15-
#ifdefHAVE_LIBLZ4
15+
#ifdefUSE_LZ4
1616
#include<lz4frame.h>
1717
#endif
1818

1919
#include"replication/basebackup_sink.h"
2020

21-
#ifdefHAVE_LIBLZ4
21+
#ifdefUSE_LZ4
2222

2323
typedefstructbbsink_lz4
2424
{
@@ -62,7 +62,7 @@ const bbsink_ops bbsink_lz4_ops = {
6262
bbsink*
6363
bbsink_lz4_new(bbsink*next,intcompresslevel)
6464
{
65-
#ifndefHAVE_LIBLZ4
65+
#ifndefUSE_LZ4
6666
ereport(ERROR,
6767
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
6868
errmsg("lz4 compression is not supported by this build")));
@@ -87,7 +87,7 @@ bbsink_lz4_new(bbsink *next, int compresslevel)
8787
#endif
8888
}
8989

90-
#ifdefHAVE_LIBLZ4
90+
#ifdefUSE_LZ4
9191

9292
/*
9393
* Begin backup.

‎src/backend/replication/basebackup_zstd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
*/
1313
#include"postgres.h"
1414

15-
#ifdefHAVE_LIBZSTD
15+
#ifdefUSE_ZSTD
1616
#include<zstd.h>
1717
#endif
1818

1919
#include"replication/basebackup_sink.h"
2020

21-
#ifdefHAVE_LIBZSTD
21+
#ifdefUSE_ZSTD
2222

2323
typedefstructbbsink_zstd
2424
{
@@ -61,7 +61,7 @@ const bbsink_ops bbsink_zstd_ops = {
6161
bbsink*
6262
bbsink_zstd_new(bbsink*next,intcompresslevel)
6363
{
64-
#ifndefHAVE_LIBZSTD
64+
#ifndefUSE_ZSTD
6565
ereport(ERROR,
6666
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
6767
errmsg("zstd compression is not supported by this build")));
@@ -86,7 +86,7 @@ bbsink_zstd_new(bbsink *next, int compresslevel)
8686
#endif
8787
}
8888

89-
#ifdefHAVE_LIBZSTD
89+
#ifdefUSE_ZSTD
9090

9191
/*
9292
* Begin backup.

‎src/bin/pg_basebackup/bbstreamer_lz4.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include<unistd.h>
1515

16-
#ifdefHAVE_LIBLZ4
16+
#ifdefUSE_LZ4
1717
#include<lz4frame.h>
1818
#endif
1919

@@ -22,7 +22,7 @@
2222
#include"common/file_perm.h"
2323
#include"common/string.h"
2424

25-
#ifdefHAVE_LIBLZ4
25+
#ifdefUSE_LZ4
2626
typedefstructbbstreamer_lz4_frame
2727
{
2828
bbstreamerbase;
@@ -69,7 +69,7 @@ const bbstreamer_ops bbstreamer_lz4_decompressor_ops = {
6969
bbstreamer*
7070
bbstreamer_lz4_compressor_new(bbstreamer*next,intcompresslevel)
7171
{
72-
#ifdefHAVE_LIBLZ4
72+
#ifdefUSE_LZ4
7373
bbstreamer_lz4_frame*streamer;
7474
LZ4F_errorCode_tctxError;
7575
LZ4F_preferences_t*prefs;
@@ -114,7 +114,7 @@ bbstreamer_lz4_compressor_new(bbstreamer *next, int compresslevel)
114114
#endif
115115
}
116116

117-
#ifdefHAVE_LIBLZ4
117+
#ifdefUSE_LZ4
118118
/*
119119
* Compress the input data to output buffer.
120120
*
@@ -280,7 +280,7 @@ bbstreamer_lz4_compressor_free(bbstreamer *streamer)
280280
bbstreamer*
281281
bbstreamer_lz4_decompressor_new(bbstreamer*next)
282282
{
283-
#ifdefHAVE_LIBLZ4
283+
#ifdefUSE_LZ4
284284
bbstreamer_lz4_frame*streamer;
285285
LZ4F_errorCode_tctxError;
286286

@@ -309,7 +309,7 @@ bbstreamer_lz4_decompressor_new(bbstreamer *next)
309309
#endif
310310
}
311311

312-
#ifdefHAVE_LIBLZ4
312+
#ifdefUSE_LZ4
313313
/*
314314
* Decompress the input data to output buffer until we run out of input
315315
* data. Each time the output buffer is full, pass on the decompressed data

‎src/bin/pg_basebackup/bbstreamer_zstd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
#include<unistd.h>
1515

16-
#ifdefHAVE_LIBZSTD
16+
#ifdefUSE_ZSTD
1717
#include<zstd.h>
1818
#endif
1919

2020
#include"bbstreamer.h"
2121
#include"common/logging.h"
2222

23-
#ifdefHAVE_LIBZSTD
23+
#ifdefUSE_ZSTD
2424

2525
typedefstructbbstreamer_zstd_frame
2626
{
@@ -65,7 +65,7 @@ const bbstreamer_ops bbstreamer_zstd_decompressor_ops = {
6565
bbstreamer*
6666
bbstreamer_zstd_compressor_new(bbstreamer*next,intcompresslevel)
6767
{
68-
#ifdefHAVE_LIBZSTD
68+
#ifdefUSE_ZSTD
6969
bbstreamer_zstd_frame*streamer;
7070

7171
Assert(next!=NULL);
@@ -99,7 +99,7 @@ bbstreamer_zstd_compressor_new(bbstreamer *next, int compresslevel)
9999
#endif
100100
}
101101

102-
#ifdefHAVE_LIBZSTD
102+
#ifdefUSE_ZSTD
103103
/*
104104
* Compress the input data to output buffer.
105105
*
@@ -225,7 +225,7 @@ bbstreamer_zstd_compressor_free(bbstreamer *streamer)
225225
bbstreamer*
226226
bbstreamer_zstd_decompressor_new(bbstreamer*next)
227227
{
228-
#ifdefHAVE_LIBZSTD
228+
#ifdefUSE_ZSTD
229229
bbstreamer_zstd_frame*streamer;
230230

231231
Assert(next!=NULL);
@@ -257,7 +257,7 @@ bbstreamer_zstd_decompressor_new(bbstreamer *next)
257257
#endif
258258
}
259259

260-
#ifdefHAVE_LIBZSTD
260+
#ifdefUSE_ZSTD
261261
/*
262262
* Decompress the input data to output buffer until we run out of input
263263
* data. Each time the output buffer is full, pass on the decompressed data

‎src/bin/pg_basebackup/pg_receivewal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include"receivelog.h"
3333
#include"streamutil.h"
3434

35-
#ifdefHAVE_LIBLZ4
35+
#ifdefUSE_LZ4
3636
#include"lz4frame.h"
3737
#endif
3838

@@ -382,7 +382,7 @@ FindStreamingStart(uint32 *tli)
382382
}
383383
elseif (!ispartial&&wal_compression_method==COMPRESSION_LZ4)
384384
{
385-
#ifdefHAVE_LIBLZ4
385+
#ifdefUSE_LZ4
386386
#defineLZ4_CHUNK_SZ64 * 1024/* 64kB as maximum chunk size read */
387387
intfd;
388388
ssize_tr;
@@ -889,7 +889,7 @@ main(int argc, char **argv)
889889
#endif
890890
break;
891891
caseCOMPRESSION_LZ4:
892-
#ifdefHAVE_LIBLZ4
892+
#ifdefUSE_LZ4
893893
if (compresslevel!=0)
894894
{
895895
pg_log_error("cannot use --compress with --compression-method=%s",

‎src/bin/pg_basebackup/t/020_pg_receivewal.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
SKIP:
142142
{
143143
skip"postgres was not built with LZ4 support", 5
144-
if (!check_pg_config("#defineHAVE_LIBLZ4 1"));
144+
if (!check_pg_config("#defineUSE_LZ4 1"));
145145

146146
# Generate more WAL including one completed, compressed segment.
147147
$primary->psql('postgres','SELECT pg_switch_wal();');

‎src/bin/pg_basebackup/walmethods.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include<time.h>
1919
#include<unistd.h>
2020

21-
#ifdefHAVE_LIBLZ4
21+
#ifdefUSE_LZ4
2222
#include<lz4frame.h>
2323
#endif
2424
#ifdefHAVE_LIBZ
@@ -70,7 +70,7 @@ typedef struct DirectoryMethodFile
7070
#ifdefHAVE_LIBZ
7171
gzFilegzfp;
7272
#endif
73-
#ifdefHAVE_LIBLZ4
73+
#ifdefUSE_LZ4
7474
LZ4F_compressionContext_tctx;
7575
size_tlz4bufsize;
7676
void*lz4buf;
@@ -114,7 +114,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_
114114
#ifdefHAVE_LIBZ
115115
gzFilegzfp=NULL;
116116
#endif
117-
#ifdefHAVE_LIBLZ4
117+
#ifdefUSE_LZ4
118118
LZ4F_compressionContext_tctx=NULL;
119119
size_tlz4bufsize=0;
120120
void*lz4buf=NULL;
@@ -160,7 +160,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_
160160
}
161161
}
162162
#endif
163-
#ifdefHAVE_LIBLZ4
163+
#ifdefUSE_LZ4
164164
if (dir_data->compression_method==COMPRESSION_LZ4)
165165
{
166166
size_tctx_out;
@@ -245,7 +245,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_
245245
gzclose(gzfp);
246246
else
247247
#endif
248-
#ifdefHAVE_LIBLZ4
248+
#ifdefUSE_LZ4
249249
if (dir_data->compression_method==COMPRESSION_LZ4)
250250
{
251251
(void)LZ4F_compressEnd(ctx,lz4buf,lz4bufsize,NULL);
@@ -265,7 +265,7 @@ dir_open_for_write(const char *pathname, const char *temp_suffix, size_t pad_to_
265265
if (dir_data->compression_method==COMPRESSION_GZIP)
266266
f->gzfp=gzfp;
267267
#endif
268-
#ifdefHAVE_LIBLZ4
268+
#ifdefUSE_LZ4
269269
if (dir_data->compression_method==COMPRESSION_LZ4)
270270
{
271271
f->ctx=ctx;
@@ -306,7 +306,7 @@ dir_write(Walfile f, const void *buf, size_t count)
306306
}
307307
else
308308
#endif
309-
#ifdefHAVE_LIBLZ4
309+
#ifdefUSE_LZ4
310310
if (dir_data->compression_method==COMPRESSION_LZ4)
311311
{
312312
size_tchunk;
@@ -394,7 +394,7 @@ dir_close(Walfile f, WalCloseMethod method)
394394
}
395395
else
396396
#endif
397-
#ifdefHAVE_LIBLZ4
397+
#ifdefUSE_LZ4
398398
if (dir_data->compression_method==COMPRESSION_LZ4)
399399
{
400400
size_tcompressed;
@@ -487,7 +487,7 @@ dir_close(Walfile f, WalCloseMethod method)
487487
if (r!=0)
488488
dir_data->lasterrno=errno;
489489

490-
#ifdefHAVE_LIBLZ4
490+
#ifdefUSE_LZ4
491491
pg_free(df->lz4buf);
492492
/* supports free on NULL */
493493
LZ4F_freeCompressionContext(df->ctx);
@@ -523,7 +523,7 @@ dir_sync(Walfile f)
523523
}
524524
}
525525
#endif
526-
#ifdefHAVE_LIBLZ4
526+
#ifdefUSE_LZ4
527527
if (dir_data->compression_method==COMPRESSION_LZ4)
528528
{
529529
DirectoryMethodFile*df= (DirectoryMethodFile*)f;

‎src/bin/pg_dump/t/002_pg_dump.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3743,7 +3743,7 @@
37433743
}
37443744
37453745
# Determine whether build supports LZ4.
3746-
my$supports_lz4 = check_pg_config("#defineHAVE_LIBLZ4 1");
3746+
my$supports_lz4 = check_pg_config("#defineUSE_LZ4 1");
37473747
37483748
# Create additional databases for mutations of schema public
37493749
$node->psql('postgres', 'create database regress_pg_dump_test;');

‎src/bin/pg_verifybackup/t/008_untar.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
'backup_archive'=>'base.tar.lz4',
4242
'decompress_program'=>$ENV{'LZ4'},
4343
'decompress_flags'=> ['-d','-m'],
44-
'enabled'=> check_pg_config("#defineHAVE_LIBLZ4 1")
44+
'enabled'=> check_pg_config("#defineUSE_LZ4 1")
4545
},
4646
{
4747
'compression_method'=>'zstd',
4848
'backup_flags'=> ['--compress','server-zstd'],
4949
'backup_archive'=>'base.tar.zst',
5050
'decompress_program'=>$ENV{'ZSTD'},
5151
'decompress_flags'=> ['-d' ],
52-
'enabled'=> check_pg_config("#defineHAVE_LIBZSTD 1")
52+
'enabled'=> check_pg_config("#defineUSE_ZSTD 1")
5353
}
5454
);
5555

‎src/bin/pg_verifybackup/t/009_extract.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
{
3131
'compression_method'=>'lz4',
3232
'backup_flags'=> ['--compress','server-lz4:5'],
33-
'enabled'=> check_pg_config("#defineHAVE_LIBLZ4 1")
33+
'enabled'=> check_pg_config("#defineUSE_LZ4 1")
3434
},
3535
{
3636
'compression_method'=>'zstd',
3737
'backup_flags'=> ['--compress','server-zstd:5'],
38-
'enabled'=> check_pg_config("#defineHAVE_LIBZSTD 1")
38+
'enabled'=> check_pg_config("#defineUSE_ZSTD 1")
3939
}
4040
);
4141

‎src/bin/pg_verifybackup/t/010_client_untar.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
'decompress_program'=>$ENV{'LZ4'},
4242
'decompress_flags'=> ['-d' ],
4343
'output_file'=>'base.tar',
44-
'enabled'=> check_pg_config("#defineHAVE_LIBLZ4 1")
44+
'enabled'=> check_pg_config("#defineUSE_LZ4 1")
4545
},
4646
{
4747
'compression_method'=>'zstd',
4848
'backup_flags'=> ['--compress','client-zstd:5'],
4949
'backup_archive'=>'base.tar.zst',
5050
'decompress_program'=>$ENV{'ZSTD'},
5151
'decompress_flags'=> ['-d' ],
52-
'enabled'=> check_pg_config("#defineHAVE_LIBZSTD 1")
52+
'enabled'=> check_pg_config("#defineUSE_ZSTD 1")
5353
}
5454
);
5555

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp