Fossil SCM

Revise workaround for OpenSSL symbol name collision problem.

mistachkin 2012-02-10 23:01 sslLinkingFix
Commit ff19cc215f4758ef22c030b9ff1da711b8e4f229
--- src/descendants.c
+++ src/descendants.c
@@ -164,11 +164,11 @@
164164
Stmt ins;
165165
Stmt q;
166166
bag_init(&seen);
167167
pqueue_init(&queue);
168168
bag_insert(&seen, rid);
169
- pqueue_insert2(&queue, rid, 0.0, 0);
169
+ pqueue_insert(&queue, rid, 0.0, 0);
170170
db_prepare(&ins, "INSERT OR IGNORE INTO ok VALUES(:rid)");
171171
db_prepare(&q,
172172
"SELECT a.pid, b.mtime FROM plink a LEFT JOIN plink b ON b.cid=a.pid"
173173
" WHERE a.cid=:rid"
174174
);
@@ -179,11 +179,11 @@
179179
db_bind_int(&q, ":rid", rid);
180180
while( db_step(&q)==SQLITE_ROW ){
181181
int pid = db_column_int(&q, 0);
182182
double mtime = db_column_double(&q, 1);
183183
if( bag_insert(&seen, pid) ){
184
- pqueue_insert2(&queue, pid, -mtime, 0);
184
+ pqueue_insert(&queue, pid, -mtime, 0);
185185
}
186186
}
187187
db_reset(&q);
188188
}
189189
bag_clear(&seen);
@@ -239,11 +239,11 @@
239239
Stmt q;
240240
241241
bag_init(&seen);
242242
pqueue_init(&queue);
243243
bag_insert(&seen, rid);
244
- pqueue_insert2(&queue, rid, 0.0, 0);
244
+ pqueue_insert(&queue, rid, 0.0, 0);
245245
db_prepare(&ins, "INSERT OR IGNORE INTO ok VALUES(:rid)");
246246
db_prepare(&q, "SELECT cid, mtime FROM plink WHERE pid=:rid");
247247
while( (N--)>0 && (rid = pqueue_extract(&queue, 0))!=0 ){
248248
db_bind_int(&ins, ":rid", rid);
249249
db_step(&ins);
@@ -251,11 +251,11 @@
251251
db_bind_int(&q, ":rid", rid);
252252
while( db_step(&q)==SQLITE_ROW ){
253253
int pid = db_column_int(&q, 0);
254254
double mtime = db_column_double(&q, 1);
255255
if( bag_insert(&seen, pid) ){
256
- pqueue_insert2(&queue, pid, mtime, 0);
256
+ pqueue_insert(&queue, pid, mtime, 0);
257257
}
258258
}
259259
db_reset(&q);
260260
}
261261
bag_clear(&seen);
262262
--- src/descendants.c
+++ src/descendants.c
@@ -164,11 +164,11 @@
164 Stmt ins;
165 Stmt q;
166 bag_init(&seen);
167 pqueue_init(&queue);
168 bag_insert(&seen, rid);
169 pqueue_insert2(&queue, rid, 0.0, 0);
170 db_prepare(&ins, "INSERT OR IGNORE INTO ok VALUES(:rid)");
171 db_prepare(&q,
172 "SELECT a.pid, b.mtime FROM plink a LEFT JOIN plink b ON b.cid=a.pid"
173 " WHERE a.cid=:rid"
174 );
@@ -179,11 +179,11 @@
179 db_bind_int(&q, ":rid", rid);
180 while( db_step(&q)==SQLITE_ROW ){
181 int pid = db_column_int(&q, 0);
182 double mtime = db_column_double(&q, 1);
183 if( bag_insert(&seen, pid) ){
184 pqueue_insert2(&queue, pid, -mtime, 0);
185 }
186 }
187 db_reset(&q);
188 }
189 bag_clear(&seen);
@@ -239,11 +239,11 @@
239 Stmt q;
240
241 bag_init(&seen);
242 pqueue_init(&queue);
243 bag_insert(&seen, rid);
244 pqueue_insert2(&queue, rid, 0.0, 0);
245 db_prepare(&ins, "INSERT OR IGNORE INTO ok VALUES(:rid)");
246 db_prepare(&q, "SELECT cid, mtime FROM plink WHERE pid=:rid");
247 while( (N--)>0 && (rid = pqueue_extract(&queue, 0))!=0 ){
248 db_bind_int(&ins, ":rid", rid);
249 db_step(&ins);
@@ -251,11 +251,11 @@
251 db_bind_int(&q, ":rid", rid);
252 while( db_step(&q)==SQLITE_ROW ){
253 int pid = db_column_int(&q, 0);
254 double mtime = db_column_double(&q, 1);
255 if( bag_insert(&seen, pid) ){
256 pqueue_insert2(&queue, pid, mtime, 0);
257 }
258 }
259 db_reset(&q);
260 }
261 bag_clear(&seen);
262
--- src/descendants.c
+++ src/descendants.c
@@ -164,11 +164,11 @@
164 Stmt ins;
165 Stmt q;
166 bag_init(&seen);
167 pqueue_init(&queue);
168 bag_insert(&seen, rid);
169 pqueue_insert(&queue, rid, 0.0, 0);
170 db_prepare(&ins, "INSERT OR IGNORE INTO ok VALUES(:rid)");
171 db_prepare(&q,
172 "SELECT a.pid, b.mtime FROM plink a LEFT JOIN plink b ON b.cid=a.pid"
173 " WHERE a.cid=:rid"
174 );
@@ -179,11 +179,11 @@
179 db_bind_int(&q, ":rid", rid);
180 while( db_step(&q)==SQLITE_ROW ){
181 int pid = db_column_int(&q, 0);
182 double mtime = db_column_double(&q, 1);
183 if( bag_insert(&seen, pid) ){
184 pqueue_insert(&queue, pid, -mtime, 0);
185 }
186 }
187 db_reset(&q);
188 }
189 bag_clear(&seen);
@@ -239,11 +239,11 @@
239 Stmt q;
240
241 bag_init(&seen);
242 pqueue_init(&queue);
243 bag_insert(&seen, rid);
244 pqueue_insert(&queue, rid, 0.0, 0);
245 db_prepare(&ins, "INSERT OR IGNORE INTO ok VALUES(:rid)");
246 db_prepare(&q, "SELECT cid, mtime FROM plink WHERE pid=:rid");
247 while( (N--)>0 && (rid = pqueue_extract(&queue, 0))!=0 ){
248 db_bind_int(&ins, ":rid", rid);
249 db_step(&ins);
@@ -251,11 +251,11 @@
251 db_bind_int(&q, ":rid", rid);
252 while( db_step(&q)==SQLITE_ROW ){
253 int pid = db_column_int(&q, 0);
254 double mtime = db_column_double(&q, 1);
255 if( bag_insert(&seen, pid) ){
256 pqueue_insert(&queue, pid, mtime, 0);
257 }
258 }
259 db_reset(&q);
260 }
261 bag_clear(&seen);
262
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -409,10 +409,11 @@
409409
#
410410
TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
411411
412412
# With HTTPS support
413413
ifdef FOSSIL_ENABLE_SSL
414
+TCC += -Dpqueue_insert=pqueue_insert_fossil
414415
TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
415416
endif
416417
417418
# With Tcl support
418419
ifdef FOSSIL_ENABLE_TCL
419420
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -409,10 +409,11 @@
409 #
410 TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
411
412 # With HTTPS support
413 ifdef FOSSIL_ENABLE_SSL
 
414 TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
415 endif
416
417 # With Tcl support
418 ifdef FOSSIL_ENABLE_TCL
419
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -409,10 +409,11 @@
409 #
410 TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
411
412 # With HTTPS support
413 ifdef FOSSIL_ENABLE_SSL
414 TCC += -Dpqueue_insert=pqueue_insert_fossil
415 TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
416 endif
417
418 # With Tcl support
419 ifdef FOSSIL_ENABLE_TCL
420
+1 -3
--- src/pqueue.c
+++ src/pqueue.c
@@ -69,14 +69,12 @@
6969
p->sz = N;
7070
}
7171
7272
/*
7373
** Insert element e into the queue.
74
-** This is now named pqueue_insert2 to avoid a symbol naming
75
-** conflict with OpenSSL.
7674
*/
77
-void pqueue_insert2(PQueue *p, int e, double v, void *pData){
75
+void pqueue_insert(PQueue *p, int e, double v, void *pData){
7876
int i, j;
7977
if( p->cnt+1>p->sz ){
8078
pqueue_resize(p, p->cnt+5);
8179
}
8280
for(i=0; i<p->cnt; i++){
8381
--- src/pqueue.c
+++ src/pqueue.c
@@ -69,14 +69,12 @@
69 p->sz = N;
70 }
71
72 /*
73 ** Insert element e into the queue.
74 ** This is now named pqueue_insert2 to avoid a symbol naming
75 ** conflict with OpenSSL.
76 */
77 void pqueue_insert2(PQueue *p, int e, double v, void *pData){
78 int i, j;
79 if( p->cnt+1>p->sz ){
80 pqueue_resize(p, p->cnt+5);
81 }
82 for(i=0; i<p->cnt; i++){
83
--- src/pqueue.c
+++ src/pqueue.c
@@ -69,14 +69,12 @@
69 p->sz = N;
70 }
71
72 /*
73 ** Insert element e into the queue.
 
 
74 */
75 void pqueue_insert(PQueue *p, int e, double v, void *pData){
76 int i, j;
77 if( p->cnt+1>p->sz ){
78 pqueue_resize(p, p->cnt+5);
79 }
80 for(i=0; i<p->cnt; i++){
81
+2 -2
--- src/tag.c
+++ src/tag.c
@@ -44,11 +44,11 @@
4444
Stmt ins; /* INSERT INTO tagxref */
4545
Stmt eventupdate; /* UPDATE event */
4646
4747
assert( tagType==0 || tagType==2 );
4848
pqueue_init(&queue);
49
- pqueue_insert2(&queue, pid, 0.0, 0);
49
+ pqueue_insert(&queue, pid, 0.0, 0);
5050
5151
/* Query for children of :pid to which to propagate the tag.
5252
** Three returns: (1) rid of the child. (2) timestamp of child.
5353
** (3) True to propagate or false to block.
5454
*/
@@ -86,11 +86,11 @@
8686
while( db_step(&s)==SQLITE_ROW ){
8787
int doit = db_column_int(&s, 2);
8888
if( doit ){
8989
int cid = db_column_int(&s, 0);
9090
double mtime = db_column_double(&s, 1);
91
- pqueue_insert2(&queue, cid, mtime, 0);
91
+ pqueue_insert(&queue, cid, mtime, 0);
9292
db_bind_int(&ins, ":rid", cid);
9393
db_step(&ins);
9494
db_reset(&ins);
9595
if( tagid==TAG_BGCOLOR ){
9696
db_bind_int(&eventupdate, ":rid", cid);
9797
--- src/tag.c
+++ src/tag.c
@@ -44,11 +44,11 @@
44 Stmt ins; /* INSERT INTO tagxref */
45 Stmt eventupdate; /* UPDATE event */
46
47 assert( tagType==0 || tagType==2 );
48 pqueue_init(&queue);
49 pqueue_insert2(&queue, pid, 0.0, 0);
50
51 /* Query for children of :pid to which to propagate the tag.
52 ** Three returns: (1) rid of the child. (2) timestamp of child.
53 ** (3) True to propagate or false to block.
54 */
@@ -86,11 +86,11 @@
86 while( db_step(&s)==SQLITE_ROW ){
87 int doit = db_column_int(&s, 2);
88 if( doit ){
89 int cid = db_column_int(&s, 0);
90 double mtime = db_column_double(&s, 1);
91 pqueue_insert2(&queue, cid, mtime, 0);
92 db_bind_int(&ins, ":rid", cid);
93 db_step(&ins);
94 db_reset(&ins);
95 if( tagid==TAG_BGCOLOR ){
96 db_bind_int(&eventupdate, ":rid", cid);
97
--- src/tag.c
+++ src/tag.c
@@ -44,11 +44,11 @@
44 Stmt ins; /* INSERT INTO tagxref */
45 Stmt eventupdate; /* UPDATE event */
46
47 assert( tagType==0 || tagType==2 );
48 pqueue_init(&queue);
49 pqueue_insert(&queue, pid, 0.0, 0);
50
51 /* Query for children of :pid to which to propagate the tag.
52 ** Three returns: (1) rid of the child. (2) timestamp of child.
53 ** (3) True to propagate or false to block.
54 */
@@ -86,11 +86,11 @@
86 while( db_step(&s)==SQLITE_ROW ){
87 int doit = db_column_int(&s, 2);
88 if( doit ){
89 int cid = db_column_int(&s, 0);
90 double mtime = db_column_double(&s, 1);
91 pqueue_insert(&queue, cid, mtime, 0);
92 db_bind_int(&ins, ":rid", cid);
93 db_step(&ins);
94 db_reset(&ins);
95 if( tagid==TAG_BGCOLOR ){
96 db_bind_int(&eventupdate, ":rid", cid);
97
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -93,10 +93,11 @@
9393
#
9494
TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
9595
9696
# With HTTPS support
9797
ifdef FOSSIL_ENABLE_SSL
98
+TCC += -Dpqueue_insert=pqueue_insert_fossil
9899
TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
99100
endif
100101
101102
# With Tcl support
102103
ifdef FOSSIL_ENABLE_TCL
103104
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -93,10 +93,11 @@
93 #
94 TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
95
96 # With HTTPS support
97 ifdef FOSSIL_ENABLE_SSL
 
98 TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
99 endif
100
101 # With Tcl support
102 ifdef FOSSIL_ENABLE_TCL
103
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -93,10 +93,11 @@
93 #
94 TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
95
96 # With HTTPS support
97 ifdef FOSSIL_ENABLE_SSL
98 TCC += -Dpqueue_insert=pqueue_insert_fossil
99 TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
100 endif
101
102 # With Tcl support
103 ifdef FOSSIL_ENABLE_TCL
104
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -93,10 +93,11 @@
9393
#
9494
TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
9595
9696
# With HTTPS support
9797
ifdef FOSSIL_ENABLE_SSL
98
+TCC += -Dpqueue_insert=pqueue_insert_fossil
9899
TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
99100
endif
100101
101102
# With Tcl support
102103
ifdef FOSSIL_ENABLE_TCL
103104
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -93,10 +93,11 @@
93 #
94 TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
95
96 # With HTTPS support
97 ifdef FOSSIL_ENABLE_SSL
 
98 TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
99 endif
100
101 # With Tcl support
102 ifdef FOSSIL_ENABLE_TCL
103
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -93,10 +93,11 @@
93 #
94 TCC = gcc -Os -Wall -L$(ZLIBDIR) -I$(ZINCDIR)
95
96 # With HTTPS support
97 ifdef FOSSIL_ENABLE_SSL
98 TCC += -Dpqueue_insert=pqueue_insert_fossil
99 TCC += -L$(OPENSSLLIBDIR) -I$(OPENSSLINCDIR)
100 endif
101
102 # With Tcl support
103 ifdef FOSSIL_ENABLE_TCL
104

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button