Skip to content

Commit 1b3f6d9

Browse files
author
carblue
committed
crypto.d: Fix templates containing string file = __FILE__
1 parent 625928e commit 1b3f6d9

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

deimos/openssl/crypto.d

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ module deimos.openssl.crypto;
119119
import deimos.openssl._d_util;
120120

121121
import core.stdc.stdlib;
122-
import std.string : toStringz;
123122

124123
public import deimos.openssl.e_os2;
125124

@@ -237,19 +236,19 @@ version (OPENSSL_NO_LOCKING) {
237236
void CRYPTO_add()(int* addr, int amount, int type) { *addr += amount; }
238237
} else {
239238
void CRYPTO_w_lock(string file = __FILE__, size_t line = __LINE__)(int type) {
240-
CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,file,line);
239+
CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,file.ptr,line);
241240
}
242241
void CRYPTO_w_unlock(string file = __FILE__, size_t line = __LINE__)(int type) {
243-
CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,file,line);
242+
CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,file.ptr,line);
244243
}
245244
void CRYPTO_r_lock(string file = __FILE__, size_t line = __LINE__)(int type) {
246-
CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,file,line);
245+
CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,file.ptr,line);
247246
}
248247
void CRYPTO_r_unlock(string file = __FILE__, size_t line = __LINE__)(int type) {
249-
CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,file,line);
248+
CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,file.ptr,line);
250249
}
251250
void CRYPTO_add(string file = __FILE__, size_t line = __LINE__)(int* addr, int amount, int type) {
252-
CRYPTO_add_lock(addr,amount,type,file,line);
251+
CRYPTO_add_lock(addr,amount,type,file.ptr,line);
253252
}
254253
}
255254

@@ -369,25 +368,25 @@ int MemCheck_off()() { return CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); }
369368
alias CRYPTO_is_mem_check_on is_MemCheck_on;
370369

371370
auto OPENSSL_malloc(string file = __FILE__, size_t line = __LINE__)(int num) {
372-
return CRYPTO_malloc(num,file.toStringz,line);
371+
return CRYPTO_malloc(num,file.ptr,line);
373372
}
374373
auto OPENSSL_strdup(string file = __FILE__, size_t line = __LINE__)(const(char)* str) {
375-
return CRYPTO_strdup(str,file,line);
374+
return CRYPTO_strdup(str,file.ptr,line);
376375
}
377376
auto OPENSSL_realloc(string file = __FILE__, size_t line = __LINE__)(void* addr, int num) {
378-
return CRYPTO_realloc(addr,num,file,line);
377+
return CRYPTO_realloc(addr,num,file.ptr,line);
379378
}
380379
auto OPENSSL_realloc_clean(string file = __FILE__, size_t line = __LINE__)(void* addr,int old_num,int num) {
381-
CRYPTO_realloc_clean(addr,old_num,num,file,line);
380+
CRYPTO_realloc_clean(addr,old_num,num,file.ptr,line);
382381
}
383382
auto OPENSSL_remalloc(string file = __FILE__, size_t line = __LINE__)(void** addr, int num) {
384-
return CRYPTO_remalloc(cast(char**)addr,num,file,line);
383+
return CRYPTO_remalloc(cast(char**)addr,num,file.ptr,line);
385384
}
386385
alias CRYPTO_free OPENSSL_freeFunc;
387386
alias CRYPTO_free OPENSSL_free;
388387

389388
auto OPENSSL_malloc_locked(string file = __FILE__, size_t line = __LINE__)(int num) {
390-
return CRYPTO_malloc_locked(num, file, line);
389+
return CRYPTO_malloc_locked(num, file.ptr, line);
391390
}
392391
alias CRYPTO_free_locked OPENSSL_free_locked;
393392

@@ -514,7 +513,7 @@ void CRYPTO_set_mem_debug_options(c_long bits);
514513
c_long CRYPTO_get_mem_debug_options();
515514

516515
auto CRYPTO_push_info(string file = __FILE__, size_t line = __LINE__)(const(char)* info) {
517-
return CRYPTO_push_info_(info, file, line);
516+
return CRYPTO_push_info_(info, file.ptr, line);
518517
}
519518
int CRYPTO_push_info_(const(char)* info, const(char)* file, int line);
520519
int CRYPTO_pop_info();
@@ -554,7 +553,7 @@ void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB* cb);
554553
/* die if we have to */
555554
void OpenSSLDie(const(char)* file,int line,const(char)* assertion);
556555
void OPENSSL_assert(string file = __FILE__, size_t line = __LINE__)(int e) {
557-
if (!e) OpenSSLDie(file, line, "assertion failed"); // No good way to translate.
556+
if (!e) OpenSSLDie(file.ptr, line, "assertion failed"); // No good way to translate.
558557
}
559558

560559
c_ulong* OPENSSL_ia32cap_loc();

0 commit comments

Comments
 (0)