WIP Changes to support building for OS/2

+ WIP Makefile updates to support building for OS/2
   - TODO: Makefile needs SYSNAME test to detect OS/2 (Bill has asked Elbert)
 + Added "__declspec(dllexport)" (via new "TX_EXTERN" #define'd in
   `tp_magic_api.h`) to public function definitions in Magic tools
   - WIP: So far just "Mirror/Flip" plugin
   - TODO: Add "TX_EXTERN" prefix to all other public Magic tool functions
 + Renamed long Magic tool source files to have shorter filenames
   - WIP: So far just "Mirror/Flip" (`mirror_flip.c` -> `mirror_f.c`)
   - TODO: Rename all other magic tool source files.

h/t Elbert Pol for providing info and some diffs!
This commit is contained in:
Bill Kendrick 2024-06-06 00:40:42 -07:00
parent 609e7cec58
commit 33db4c16f5
7 changed files with 85 additions and 52 deletions

View file

@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last modified: June 29, 2023
Last modified: June 6, 2024
*/
#include <stdio.h>
@ -101,7 +101,7 @@ static const char *problemFontExtensions[] = {
#include <sys/poll.h>
#include <sys/wait.h>
#ifdef _POSIX_PRIORITY_SCHEDULING
#if defined(_POSIX_PRIORITY_SCHEDULING) && !defined(__OS2__)
#include <sched.h>
#else
#define sched_yield()

View file

@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: June 13, 2023
Last updated: June 6, 2024
*/
#ifndef FONTS_H
@ -28,10 +28,7 @@
// plan to rip this out as soon as it is considered stable
//#define THREADED_FONTS
#define FORKED_FONTS
#if defined(WIN32) || defined(__BEOS__)
#undef FORKED_FONTS
#endif
#ifdef __ANDROID__
#if defined(WIN32) || defined(__BEOS__) || defined (__OS2__) || defined(__ANDROID__)
#undef FORKED_FONTS
#endif

View file

@ -10,6 +10,12 @@
#define gettext_noop(String) String
#endif
#ifdef __OS2__
# define TX_EXTERN __declspec(dllexport)
#else
# define TX_EXTERN
#endif
/* min() and max() variable comparisons: */
#ifdef __GNUC__

View file

@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
June 14, 2002 - June 2, 2024
June 14, 2002 - June 6, 2024
*/
#include "platform.h"
@ -652,7 +652,7 @@ int TP_EventFilter(void *data, EVENT_FILTER_EVENT_TYPE * event);
/* #define fmemopen_alternative *//* Uncomment this to test the fmemopen alternative in systems were fmemopen exists */
/* *INDENT-ON* */
#if defined (WIN32) || defined (__APPLE__) || defined(__NetBSD__) || defined(__sun) || defined(__ANDROID__) /* MINGW/MSYS, NetBSD, and MacOSX need it, at least for now */
#if defined (WIN32) || defined (__APPLE__) || defined(__NetBSD__) || defined(__sun) || defined(__OS2__) || defined(__ANDROID__) /* MINGW/MSYS, NetBSD, and MacOSX need it, at least for now */
#define fmemopen_alternative
#endif
@ -8029,6 +8029,8 @@ void show_version(int details)
printf(" Built for Maemo (NOKIA_770)\n");
#elif OLPC_XO
printf(" Built for XO (OLPC_XO)\n");
#elif OS2
printf(" Built for OS2 (OS2)\n");
#elif __ANDROID__
printf(" Built for Android (__ANDROID__)\n");
#else