Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 7c4fe68

Browse files
author
Mikhail Pozdnyakov
committed
Make libwds compile on Windows
1 parent e1c644d commit 7c4fe68

File tree

8 files changed

+28
-5
lines changed

8 files changed

+28
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
WDS is a set of libraries for developers who want to build Wi-Fi Display applications on linux.
44

55
WDS consists of:
6-
* libwds: Main library implements a Wi-Fi Display dialect of RTSP that includes the parser, actual negotiation logic for sink and source, and the related data structures. It is not tied to any specific connection manager, media framework or main loop
6+
* libwds: Main library implements a Wi-Fi Display dialect of RTSP that includes the parser, actual negotiation logic for sink and source, and the related data structures. It is not tied to any specific connection manager, media framework or main loop. This Library is also compatible with MSVC.
77
* network: Supports integration with GLib main loop and GStreamer
88
* p2p: Supports integration with Connman Wifi P2P features
99

libwds/public/peer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
#include <string>
2626

27+
#include "wds_export.h"
28+
2729
namespace wds {
2830

2931
enum ErrorType {
@@ -41,7 +43,7 @@ enum ErrorType {
4143
*
4244
* Peer is a base class for sink and source state machines.
4345
*/
44-
class Peer {
46+
class WDS_EXPORT Peer {
4547
public:
4648
/**
4749
* Delegate interface.

libwds/public/sink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SinkMediaManager;
3131
/**
3232
* Sink state machine implementation
3333
*/
34-
class Sink : public Peer {
34+
class WDS_EXPORT Sink : public Peer {
3535
public:
3636
virtual ~Sink() {}
3737

libwds/public/source.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SourceMediaManager;
3131
/**
3232
* Source state machine implementation
3333
*/
34-
class Source : public Peer {
34+
class WDS_EXPORT Source : public Peer {
3535
public:
3636
/**
3737
* Factory method that creates Source state machine.

libwds/public/wds_export.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
#ifndef LIBWDS_PUBLIC_WDS_EXPORT_H_
2323
#define LIBWDS_PUBLIC_WDS_EXPORT_H_
2424

25-
#define WDS_EXPORT __attribute__((visibility("default")))
25+
#if defined _WIN32 || defined _WIN64
26+
#define WDS_EXPORT __declspec(dllexport)
27+
#else
28+
#define WDS_EXPORT __attribute__((visibility("default")))
29+
#endif
30+
2631

2732
#endif // LIBWDS_PUBLIC_WDS_EXPORT_H_

libwds/rtsp/errorlexer.l

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@
2727
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
2828
* 02110-1301 USA
2929
*/
30+
31+
#include <stdint.h>
32+
33+
#define YY_NO_UNISTD_H 1
3034
}
3135

3236
%{
3337
#include <string>
38+
3439
#include "parser.h"
40+
3541
#define yyterminate() return(END)
3642
%}
3743

libwds/rtsp/headerlexer.l

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@
2727
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
2828
* 02110-1301 USA
2929
*/
30+
31+
#include <stdint.h>
32+
33+
#define YY_NO_UNISTD_H 1
3034
}
3135

3236
%{
3337
#include <string>
38+
3439
#include "parser.h"
3540
#define yyterminate() return(END)
3641
%}

libwds/rtsp/messagelexer.l

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,15 @@
2727
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
2828
* 02110-1301 USA
2929
*/
30+
31+
#include <stdint.h>
32+
33+
#define YY_NO_UNISTD_H 1
3034
}
3135

3236
%{
3337
#include <string>
38+
3439
#include "parser.h"
3540
#define yyterminate() return(END)
3641
%}

0 commit comments

Comments
 (0)