Skip to content
This repository was archived by the owner on Sep 17, 2020. It is now read-only.

Commit 5e001ab

Browse files
NCrashedNCrashed
authored andcommitted
Fixing linking problems with std.datetime.Interval.invariant
1 parent dbe7050 commit 5e001ab

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

source/pgator/db/pq/types/conv.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Bson toBson(PQType type)(ubyte[] val, shared IConnection conn)
201201
else
202202
return serializeToBson(convVal.to!string);
203203
}
204-
else static if(is(T == struct))
204+
else static if(is(T == struct) || is(T == class))
205205
{
206206
return serializeToBson(convVal);
207207
}

source/pgator/db/pq/types/time.d

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ struct PGInterval
323323
{
324324
private Interval!SysTime interval;
325325
alias interval this;
326+
327+
this(Interval!SysTime val)
328+
{
329+
interval = val;
330+
}
326331

327332
static PGInterval fromBson(Bson bson)
328333
{
@@ -340,6 +345,13 @@ struct PGInterval
340345
}
341346
}
342347

348+
/// Avoiding linking problems when std.datetime.Interval invariant isn't generated
349+
/// by dmd. See at: std.datetime.Interval:18404
350+
private debug extern(C) void _D3std8datetime36__T8IntervalTS3std8datetime7SysTimeZ8Interval11__invariantMxFNaZv()
351+
{
352+
353+
}
354+
343355
PGInterval convert(PQType type)(ubyte[] val)
344356
if(type == PQType.Interval)
345357
{

0 commit comments

Comments
 (0)