make compileable on win32 with msys
authorKonrad Rosenbaum <konrad@silmor.de>
Tue, 3 Jan 2017 20:48:45 +0000 (21:48 +0100)
committerKonrad Rosenbaum <konrad@silmor.de>
Tue, 3 Jan 2017 20:48:45 +0000 (21:48 +0100)
Change-Id: Icd5afaafd5d8ab9304fbd78356c7ee4ff7f98117

Makefile
commonlib/commonexport.h
commonlib/commonlib.pro
iface/wext/keyvalue.h
pack
sesscli/scrand.cpp [new file with mode: 0644]
sesscli/scrand.h
sesscli/scrand.pri
sesscli/sesscli.pro
sessman/sessman.pro

index 9904e4b..2b5a40f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -99,6 +99,7 @@ woc:
 wbase: woc
        mkdir -p bin
        cp -a pack/qtbase/lib* bin
+       -cp -a pack/qtbase/*.dll bin
        cp -a pack/qtbase/*.qm bin
 
 server: wob
@@ -123,6 +124,7 @@ winclient: client
 taurus:
        -$(MKDIR) bin
        cd taurus && $(QMAKE) $(QMCFG) $(QMAKEFLAGS) && $(MAKE)
+       #cd taurus/aurora && bash ./build-gpg.sh
        $(COPY) taurus/lib/* bin/
        -$(COPY) taurus/aurora/gpg/bin/gpg bin/
        -$(COPY) taurus/aurora/gpg/bin/gpg.exe bin/
index 921f2ca..4cac02b 100644 (file)
@@ -1,7 +1,7 @@
 
 #include <QtCore/QtGlobal>
 
-#ifndef MAGICSMOKE_COMMON_LIB_BUILD
+#ifdef MAGICSMOKE_COMMON_LIB_BUILD
 #define MAGICSMOKE_COMMON_EXPORT Q_DECL_EXPORT
 #else
 #define MAGICSMOKE_COMMON_EXPORT Q_DECL_IMPORT
index dc2379e..3fff3fc 100644 (file)
@@ -3,7 +3,7 @@
 
 #basics
 TEMPLATE = lib
-VERSION = 0.1
+VERSION = 
 TARGET = magicsmoke-common
 
 include(../basics.pri)
index f294ff2..5d2f0ae 100644 (file)
@@ -4,14 +4,14 @@
 // Description: removes abstract flag from classes that only need to be abstract in PHP
 //
 //
-// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2009-2011
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2016
 //
 // Copyright: See README/COPYING.GPL files that come with this distribution
 //
 //
 
-#ifndef MAGICSMOKE_MOORDER_H
-#define MAGICSMOKE_MOORDER_H
+#ifndef MAGICSMOKE_KEYVALUE_H
+#define MAGICSMOKE_KEYVALUE_H
 
 #include "MOKeyValuePairAbstract"
 #include "misc.h"
@@ -30,7 +30,7 @@ class MSIFACE_EXPORT MOKeyValuePair:public MOKeyValuePairAbstract
        WOBJECT(MOKeyValuePair)
 public:
        MOKeyValuePair(QString k,QString v){setkey(k);setvalue(v);setisnull(false);}
-       MOKeyValuePair(QString k,nullptr_t){setkey(k);setisnull(true);}
+       MOKeyValuePair(QString k,std::nullptr_t){setkey(k);setisnull(true);}
        
        inline operator QPair<QString,QString> ()
        {
diff --git a/pack b/pack
index f2a5d37..3a3c81a 160000 (submodule)
--- a/pack
+++ b/pack
@@ -1 +1 @@
-Subproject commit f2a5d37c76272477abc5f5a1c668b7d1467be0ef
+Subproject commit 3a3c81aaaf035bd578c30ed37aba7875fed6765a
diff --git a/sesscli/scrand.cpp b/sesscli/scrand.cpp
new file mode 100644 (file)
index 0000000..b82d604
--- /dev/null
@@ -0,0 +1,60 @@
+//
+// C++ Interface: Random Number Retriever
+//
+//
+// Author: Konrad Rosenbaum <konrad@silmor.de>, (C) 2016
+//
+// Copyright: See README/COPYING.GPL files that come with this distribution
+//
+//
+
+#include "scrand.h"
+
+#ifdef Q_OS_WIN32
+#include <windows.h>
+//#pragma comment(lib, "advapi32.lib")
+#else
+#include <QFile>
+#endif
+
+#include <QDebug>
+
+namespace MagicSmokeRandom {
+
+/// Get some crypto strength random bytes. May return less than requested.
+QByteArray getRandomBytes(quint8 bytes)
+{
+       if(bytes==0)return QByteArray();
+#if defined(Q_OS_UNIX)||defined(Q_OS_LINUX)||defined(Q_OS_DARWIN)
+       //try urandom, then random
+       QFile fd("/dev/urandom");
+       if(!fd.open(QIODevice::ReadOnly)){
+               fd.setFileName("/dev/random");
+               if(!fd.open(QIODevice::ReadOnly)){
+                       qDebug()<<"Unable to open /dev/{u}random - sorry.";
+                       return QByteArray();
+               }
+       }
+       QByteArray r=fd.read(bytes);
+       fd.close();
+       return r;
+#elif defined(Q_OS_WIN32)
+       BYTE data[256];
+       HCRYPTPROV hCryptProv=0;
+       if (!::CryptAcquireContextW(&hCryptProv, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)){
+               qDebug()<<"Error: Unable to acquire crypto context.";
+               return QByteArray();
+       }
+       QByteArray r;
+       if(::CryptGenRandom(hCryptProv,bytes,data)){
+               r=QByteArray((const char*)data,bytes);
+       }else{
+               qDebug()<<"Error: Unable to get random numbers from OS.";
+       }
+       if(!::CryptReleaseContext(hCryptProv, 0))
+               qDebug()<<"Warning: unable to release crypto context!";
+       return r;
+#endif
+}
+
+}
index 873c074..691a618 100644 (file)
 #ifndef MAGICSMOKE_SC_RAND_H
 #define MAGICSMOKE_SC_RAND_H
 
-#ifdef Q_OS_WIN32
-#include <windows.h>
-#pragma comment(lib, "advapi32.lib")
-#else
-#include <QFile>
-#endif
-
 #include <QByteArray>
 
 namespace MagicSmokeRandom {
 
 /// Get some crypto strength random bytes. May return less than requested.
-inline QByteArray getRandomBytes(quint8 bytes)
-{
-       if(bytes==0)return QByteArray();
-#if defined(Q_OS_UNIX)||defined(Q_OS_LINUX)||defined(Q_OS_DARWIN)
-       //try urandom, then random
-       QFile fd("/dev/urandom");
-       if(!fd.open(QIODevice::ReadOnly)){
-               fd.setFileName("/dev/random");
-               if(!fd.open(QIODevice::ReadOnly)){
-                       qDebug()<<"Unable to open /dev/{u}random - sorry.";
-                       return QByteArray();
-               }
-       }
-       QByteArray r=fd.read(bytes);
-       fd.close();
-       return r;
-#elif defined(Q_OS_WIN32)
-       BYTE data[256];
-       HCRYPTPROV hCryptProv=0;
-       if (!::CryptAcquireContextW(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)){
-               qDebug()<<"Error: Unable to acquire crypto context.";
-               return QByteArray();
-       }
-       QByteArray r;
-       if(::CryptGenRandom(hCryptProv,bytes,data)){
-               r=QByteArray((const char*)data,bytes);
-       }else{
-               qDebug()<<"Error: Unable to get random numbers from OS.";
-       }
-       if(!::CryptReleaseContext(hProvider, 0))
-               qDebug()<<"Warning: unable to release crypto context!";
-       return r;
-#endif
-}
+QByteArray getRandomBytes(quint8 bytes);
 
 }
 
index 9d95f27..5f83a49 100644 (file)
@@ -1,5 +1,7 @@
 # Random Stuff
 
+SOURCES += $$PWD/scrand.cpp
+
 win32 {
-#LIBS += -ladvapi32
+ LIBS += -ladvapi32
 }
index 9f7e5d4..375bd6f 100644 (file)
@@ -3,7 +3,7 @@
 
 #basics
 TEMPLATE = lib
-VERSION = 0.1
+VERSION = 
 TARGET = magicsmoke-sesscli
 
 include(../basics.pri)
@@ -16,8 +16,8 @@ TRANSLATIONS = \
        smoke-sc_en.ts
 
 #main source files
-SOURCES = scli.cpp
-HEADERS = scli.h
+SOURCES += scli.cpp
+HEADERS += scli.h
 INCLUDEPATH += .
 
 #make sure exports are ok
index 42fca3b..5e6d0a5 100644 (file)
@@ -3,7 +3,7 @@
 
 #basics
 TEMPLATE = app
-VERSION = 0.1
+VERSION = 
 TARGET = magicsmoke-sessman
 
 include(../basics.pri)
@@ -17,8 +17,8 @@ TRANSLATIONS = \
        smoke-sm_en.ts
 
 #main source files
-SOURCES = sman.cpp login.cpp
-HEADERS = sman.h login.h
+SOURCES += sman.cpp login.cpp
+HEADERS += sman.h login.h
 INCLUDEPATH += .
 DEPENDPATH += $$INCLUDEPATH