Skip to content

Commit

Permalink
FIX 2 errors on PPC_DARWIN
Browse files Browse the repository at this point in the history
FIX 2 errors on PPC_DARWIN

 1)
FIX error on PPC_DARWIN by adding M3_BOOL_H_INCLUDED
modula3#995 (comment)
= =
M3CC.c:9: error: redefinition of typedef ‘BOOL’
m3core.h:46: error: previous declaration of ‘BOOL’ was here
make: *** [M3CC.o] Error 1
= =

 a-la
m3-sys\m3gdb\gdb\gdb\m3-bool.h
==

#ifndef M3_BOOL_H_INCLUDED
#define M3_BOOL_H_INCLUDED
typedef int BOOL;
#define TRUE 1
#define FALSE 0
#endif

==

 2)

FIX error on PPC_DARWIN by adding M3_USOCKET__SOCKLEN_T_H_INCLUDED

modula3#995 (comment)
= =
In file included from CerrnoC.c:6:
m3core.h:721: error: redefinition of typedef ‘Usocket__socklen_t’
m3core.h:698: error: previous declaration of ‘Usocket__socklen_t’ was here
make: *** [CerrnoC.o] Error 1
= =

 by preprocessor var M3_USOCKET__SOCKLEN_T_H_INCLUDED :

#ifndef M3_USOCKET__SOCKLEN_T_H_INCLUDED
#define M3_USOCKET__SOCKLEN_T_H_INCLUDED

typedef m3_socklen_t Usocket__socklen_t;

#endif
  • Loading branch information
VictorMiasnikov committed Nov 24, 2023
1 parent 4499ba5 commit ff5f2db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions m3-libs/m3core/src/m3core.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@
#include "winsock2.h"
#include "ws2tcpip.h"
#endif
#ifndef M3_BOOL_H_INCLUDED
#define M3_BOOL_H_INCLUDED
typedef int BOOL;
#define TRUE 1
#define FALSE 0
#endif

/* __DARWIN_UNIX03 defaults to 1 on older and newer headers,
* but older headers still have context "ss" instead of "__ss"
Expand Down Expand Up @@ -695,7 +698,10 @@ typedef int/*not socklen_t*/ m3c_socklen_t;
#endif

#define Usocket__socklen_t Usocket__socklen_t /* inhibit m3c type */
#ifndef M3_USOCKET__SOCKLEN_T_H_INCLUDED
#define M3_USOCKET__SOCKLEN_T_H_INCLUDED
typedef m3_socklen_t Usocket__socklen_t;
#endif

typedef struct {
/* verified to exactly match struct linger in UnixC.c, except for Cygwin */
Expand All @@ -718,7 +724,10 @@ typedef struct {
#define Usocket__socklen_t Usocket__socklen_t /* inhibit m3c type */
typedef M3SockAddrUnionAll* Usocket__struct_sockaddr_in_star;
typedef const M3SockAddrUnionAll* Usocket__const_struct_sockaddr_in_star;
#ifndef M3_USOCKET__SOCKLEN_T_H_INCLUDED
#define M3_USOCKET__SOCKLEN_T_H_INCLUDED
typedef m3_socklen_t Usocket__socklen_t;
#endif
typedef m3_socklen_t* Usocket__socklen_t_star;

int __cdecl Usocket__listen(int s, int backlog);
Expand Down
3 changes: 3 additions & 0 deletions m3-sys/m3back/src/M3CC.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
extern "C" {
#endif

#ifndef M3_BOOL_H_INCLUDED
#define M3_BOOL_H_INCLUDED
typedef int BOOL;
#define FALSE 0
#define TRUE 1
#endif

TEXT
__cdecl
Expand Down

0 comments on commit ff5f2db

Please sign in to comment.