Skip to content

Commit 0a3c632

Browse files
committed
Fix linker error when using dub to import *just* vibe-d:core, but not all of vibe.d.
1 parent 7061d82 commit 0a3c632

File tree

6 files changed

+27
-22
lines changed

6 files changed

+27
-22
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v0.1.6 - 2016-09-08
2+
=====================
3+
- **Change:** If not using dub, vibe.d support is now enabled with -version=Have_vibe_d_core, not -version=Have_vibe_d (@Abscissa)
4+
- **Fixed:** Linker error when using dub to import *just* vibe-d:core, but not all of vibe.d. (@Abscissa)
5+
16
v0.1.5 - 2016-09-08
27
=====================
38
- **New:** [#73](https://github.com/mysql-d/mysql-native/issues/73): [Integration testing](https://travis-ci.org/mysql-d/mysql-native) via [travis-ci](https://travis-ci.org/). (@Abscissa)

source/app.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Usage: app [connection string]
44
If connection string isn't provided, the following default connection string will be used:
55
host=localhost;port=3306;user=testuser;pwd=testpassword;db=testdb
66
7-
(optional) -version=Have_vibe_d:
7+
(optional) -version=Have_vibe_d_core:
88
Link with Vibe.d, and run test using use Vibe.d sockets instead of Phobos sockets.
99
1010
(optional) -version=UseConnPool:
11-
Run test using use Vibe.d conenction pool. Requires -version=Have_vibe_d
11+
Run test using use Vibe.d conenction pool. Requires -version=Have_vibe_d_core
1212
+/
1313

1414
import mysql.connection;

source/mysql/common.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import std.string;
1212
import std.traits;
1313
import std.variant;
1414

15-
version(Have_vibe_d)
15+
version(Have_vibe_d_core)
1616
{
1717
static if(__traits(compiles, (){ import vibe.core.net; } ))
1818
import vibe.core.net;
@@ -46,7 +46,7 @@ alias MySQLProtocolException MYXProtocol;
4646

4747
// Phobos/Vibe.d type aliases
4848
package alias std.socket.TcpSocket PlainPhobosSocket;
49-
version(Have_vibe_d)
49+
version(Have_vibe_d_core)
5050
{
5151
package alias vibe.core.net.TCPConnection PlainVibeDSocket;
5252
}
@@ -132,7 +132,7 @@ package class MySQLSocketPhobos : MySQLSocket
132132
}
133133

134134
// Wraps a Vibe.d socket with the common interface
135-
version(Have_vibe_d) {
135+
version(Have_vibe_d_core) {
136136
package class MySQLSocketVibeD : MySQLSocket
137137
{
138138
private PlainVibeDSocket socket;

source/mysql/connection.d

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ debug(MYSQL_INTEGRATION_TESTS)
1616
public import mysql.test.regression;
1717
}
1818

19-
version(Have_vibe_d)
19+
version(Have_vibe_d_core)
2020
{
2121
static if(__traits(compiles, (){ import vibe.core.net; } ))
2222
import vibe.core.net;
@@ -104,7 +104,7 @@ package:
104104
void bumpPacket() { _cpn++; }
105105
void resetPacket() { _cpn = 0; }
106106

107-
version(Have_vibe_d) {} else
107+
version(Have_vibe_d_core) {} else
108108
pure const nothrow invariant()
109109
{
110110
assert(_socketType != MySQLSocketType.vibed);
@@ -320,7 +320,7 @@ package:
320320

321321
static PlainVibeDSocket defaultOpenSocketVibeD(string host, ushort port)
322322
{
323-
version(Have_vibe_d)
323+
version(Have_vibe_d_core)
324324
return vibe.core.net.connectTCP(host, port);
325325
else
326326
assert(0);
@@ -336,10 +336,10 @@ package:
336336
break;
337337

338338
case MySQLSocketType.vibed:
339-
version(Have_vibe_d) {
339+
version(Have_vibe_d_core) {
340340
_socket = new MySQLSocketVibeD(_openSocketVibeD(_host, _port));
341341
break;
342-
} else assert(0, "Unsupported socket type. Need version Have_vibe_d.");
342+
} else assert(0, "Unsupported socket type. Need version Have_vibe_d_core.");
343343
}
344344
}
345345

@@ -445,7 +445,7 @@ public:
445445
*
446446
* Parameters:
447447
* socketType = Whether to use a Phobos or Vibe.d socket. Default is Phobos,
448-
* unless -version=Have_vibe_d is used.
448+
* unless -version=Have_vibe_d_core is used.
449449
* openSocket = Optional callback which should return a newly-opened Phobos
450450
* or Vibe.d TCP socket. This allows custom sockets to be used,
451451
* subclassed from Phobos's or Vibe.d's sockets.
@@ -457,7 +457,7 @@ public:
457457
*/
458458
this(string host, string user, string pwd, string db, ushort port = 3306, SvrCapFlags capFlags = defaultClientFlags)
459459
{
460-
version(Have_vibe_d)
460+
version(Have_vibe_d_core)
461461
enum defaultSocketType = MySQLSocketType.vibed;
462462
else
463463
enum defaultSocketType = MySQLSocketType.phobos;
@@ -468,8 +468,8 @@ public:
468468
///ditto
469469
this(MySQLSocketType socketType, string host, string user, string pwd, string db, ushort port = 3306, SvrCapFlags capFlags = defaultClientFlags)
470470
{
471-
version(Have_vibe_d) {} else
472-
enforceEx!MYX(socketType != MySQLSocketType.vibed, "Cannot use Vibe.d sockets without -version=Have_vibe_d");
471+
version(Have_vibe_d_core) {} else
472+
enforceEx!MYX(socketType != MySQLSocketType.vibed, "Cannot use Vibe.d sockets without -version=Have_vibe_d_core");
473473

474474
this(socketType, &defaultOpenSocketPhobos, &defaultOpenSocketVibeD,
475475
host, user, pwd, db, port, capFlags);
@@ -482,7 +482,7 @@ public:
482482
this(MySQLSocketType.phobos, openSocket, null, host, user, pwd, db, port, capFlags);
483483
}
484484

485-
version(Have_vibe_d)
485+
version(Have_vibe_d_core)
486486
///ditto
487487
this(OpenSocketCallbackVibeD openSocket,
488488
string host, string user, string pwd, string db, ushort port = 3306, SvrCapFlags capFlags = defaultClientFlags)
@@ -505,8 +505,8 @@ public:
505505
{
506506
enforceEx!MYX(capFlags & SvrCapFlags.PROTOCOL41, "This client only supports protocol v4.1");
507507
enforceEx!MYX(capFlags & SvrCapFlags.SECURE_CONNECTION, "This client only supports protocol v4.1 connection");
508-
version(Have_vibe_d) {} else
509-
enforceEx!MYX(socketType != MySQLSocketType.vibed, "Cannot use Vibe.d sockets without -version=Have_vibe_d");
508+
version(Have_vibe_d_core) {} else
509+
enforceEx!MYX(socketType != MySQLSocketType.vibed, "Cannot use Vibe.d sockets without -version=Have_vibe_d_core");
510510

511511
_socketType = socketType;
512512
_host = host;
@@ -531,7 +531,7 @@ public:
531531
*
532532
* Parameters:
533533
* socketType = Whether to use a Phobos or Vibe.d socket. Default is Phobos
534-
* unless -version=Have_vibe_d is used.
534+
* unless -version=Have_vibe_d_core is used.
535535
* openSocket = Optional callback which should return a newly-opened Phobos
536536
* or Vibe.d TCP socket. This allows custom sockets to be used,
537537
* subclassed from Phobos's or Vibe.d's sockets.
@@ -558,7 +558,7 @@ public:
558558
this(openSocket, a[0], a[1], a[2], a[3], to!ushort(a[4]), capFlags);
559559
}
560560

561-
version(Have_vibe_d)
561+
version(Have_vibe_d_core)
562562
///ditto
563563
this(OpenSocketCallbackVibeD openSocket, string cs, SvrCapFlags capFlags = defaultClientFlags)
564564
{
@@ -571,7 +571,7 @@ public:
571571
return _open == OpenState.notConnected || !_socket.connected;
572572
}
573573

574-
version(Have_vibe_d)
574+
version(Have_vibe_d_core)
575575
{
576576
void acquire() { if( _socket ) _socket.acquire(); }
577577
void release() { if( _socket ) _socket.release(); }

source/mysql/db.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module mysql.db;
99
public import mysql.connection;
1010
import std.conv;
1111

12-
version(Have_vibe_d)
12+
version(Have_vibe_d_core)
1313
{
1414
import vibe.core.connectionpool;
1515

source/mysql/package.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* This module supports both Phobos sockets and $(LINK http://vibed.org/, Vibe.d)
4545
* sockets. Vibe.d support is disabled by default, to avoid unnecessary
4646
* depencency on Vibe.d. To enable Vibe.d support, use:
47-
* -version=Have_vibe_d
47+
* -version=Have_vibe_d_core
4848
*
4949
* If you compile using $(LINK https://github.com/rejectedsoftware/dub, DUB),
5050
* and your project uses Vibe.d, then the -version flag above will be included

0 commit comments

Comments
 (0)