From 4a4a78e76912ddc12ca3d7bef50c102294a4432c Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Tue, 15 Sep 2020 17:30:31 +0300 Subject: [PATCH] [harbour-lib] Pulled in HarbourLib updates Now this code has a chance to work on a 64-bit system --- app/app.pro | 2 ++ app/stubs/libexpat.c | 27 ++++++++++++++------------- app/stubs/libmagic.c | 27 ++++++++++++++------------- app/stubs/libudev.c | 27 ++++++++++++++------------- harbour-lib | 2 +- 5 files changed, 45 insertions(+), 40 deletions(-) diff --git a/app/app.pro b/app/app.pro index c733ea3..505a7c8 100644 --- a/app/app.pro +++ b/app/app.pro @@ -185,6 +185,7 @@ HEADERS += \ $$HARBOUR_INCLUDE_DIR/HarbourImageProvider.h \ $$HARBOUR_INCLUDE_DIR/HarbourJson.h \ $$HARBOUR_INCLUDE_DIR/HarbourPluginLoader.h \ + $$HARBOUR_INCLUDE_DIR/HarbourSystem.h \ $$HARBOUR_INCLUDE_DIR/HarbourTask.h \ $$HARBOUR_INCLUDE_DIR/HarbourTheme.h @@ -197,6 +198,7 @@ SOURCES += \ $$HARBOUR_SRC_DIR/HarbourJson.cpp \ $$HARBOUR_SRC_DIR/HarbourMce.cpp \ $$HARBOUR_SRC_DIR/HarbourPluginLoader.cpp \ + $$HARBOUR_SRC_DIR/HarbourSystem.cpp \ $$HARBOUR_SRC_DIR/HarbourTask.cpp \ $$HARBOUR_SRC_DIR/HarbourTheme.cpp diff --git a/app/stubs/libexpat.c b/app/stubs/libexpat.c index e74fffd..f9eb32f 100644 --- a/app/stubs/libexpat.c +++ b/app/stubs/libexpat.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2015 Jolla Ltd. - * Contact: Slava Monich + * Copyright (C) 2015-2020 Jolla Ltd. + * Copyright (C) 2015-2020 Slava Monich * * You may use this file under the terms of the BSD license as follows: * @@ -8,15 +8,15 @@ * modification, are permitted provided that the following conditions * are met: * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Nemo Mobile nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the names of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -34,6 +34,7 @@ #include #include #include +#include "HarbourSystem.h" #define EXPAT_FUNCTIONS(f) \ f(XML_Parser, XML_ExternalEntityParserCreate, \ @@ -75,7 +76,7 @@ #define EXPAT_NUM_FUNCTIONS (sizeof(expat_names)/sizeof(expat_names[0])) #define EXPAT_NO_HANDLE ((void*)-1) -#define EXPAT_SO "/usr/lib/libexpat.so.1" +#define EXPAT_SO "libexpat.so.1" static const char* expat_names[] = { "XML_ParserCreate", @@ -101,7 +102,7 @@ XML_ParserCreate( const XML_Char* encoding) { if (!expat.handle) { - expat.handle = dlopen(EXPAT_SO, RTLD_LAZY); + expat.handle = HarbourDlopen(EXPAT_SO, RTLD_LAZY); if (expat.handle) { unsigned int i; for (i=0; i + * Copyright (C) 2015-2020 Jolla Ltd. + * Copyright (C) 2015-2020 Slava Monich * * You may use this file under the terms of the BSD license as follows: * @@ -8,15 +8,15 @@ * modification, are permitted provided that the following conditions * are met: * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Nemo Mobile nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the names of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -34,6 +34,7 @@ #include #include #include +#include "HarbourSystem.h" #define MAGIC_FUNCTIONS(f) \ f(void, magic_close, \ @@ -45,7 +46,7 @@ #define MAGIC_NUM_FUNCTIONS (sizeof(magic_names)/sizeof(magic_names[0])) #define MAGIC_NO_HANDLE ((void*)-1) -#define MAGIC_SO "/usr/lib/libmagic.so.1" +#define MAGIC_SO "libmagic.so.1" static const char* magic_names[] = { "magic_open", @@ -69,7 +70,7 @@ static struct { magic_t magic_open(int flags) { if (!magic.handle) { - magic.handle = dlopen(MAGIC_SO, RTLD_LAZY); + magic.handle = HarbourDlopen(MAGIC_SO, RTLD_LAZY); if (magic.handle) { unsigned int i; for (i=0; i + * Copyright (C) 2015-2020 Jolla Ltd. + * Copyright (C) 2015-2020 Slava Monich * * You may use this file under the terms of the BSD license as follows: * @@ -8,15 +8,15 @@ * modification, are permitted provided that the following conditions * are met: * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Nemo Mobile nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the names of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -34,6 +34,7 @@ #include #include #include +#include "HarbourSystem.h" #define LIBUDEV_FUNCTIONS(f) \ f(struct udev*, udev_unref,\ @@ -78,7 +79,7 @@ #define LIBUDEV_NUM_FUNCTIONS (sizeof(libudev_names)/sizeof(libudev_names[0])) #define LIBUDEV_NO_HANDLE ((void*)-1) -#define LIBUDEV_SO "/usr/lib/libudev.so.1" +#define LIBUDEV_SO "libudev.so.1" static const char* libudev_names[] = { "udev_new", @@ -103,7 +104,7 @@ struct udev* udev_new() { if (!libudev.handle) { - libudev.handle = dlopen(LIBUDEV_SO, RTLD_LAZY); + libudev.handle = HarbourDlopen(LIBUDEV_SO, RTLD_LAZY); if (libudev.handle) { unsigned int i; for (i=0; i