Skip to content

Building on FreeBSD #241

@krowbar

Description

@krowbar

On my version at least (13.0-RELEASE-p7) there is no need to redefine the imports from <sys/endian.h>, it matches the include of OpenBSD. Although it compiles fine, it fails on import (betoh32 undefined). The patch below fixes it for me.

I believe in the source this would be in psycopg_c/psycopg_c/_psycopg/endian.pxd

--- psycopg_c/_psycopg.c.orig   2022-03-08 16:11:25 UTC
+++ psycopg_c/_psycopg.c
@@ -1055,11 +1055,11 @@ typedef enum {
 #      define __LITTLE_ENDIAN LITTLE_ENDIAN
 #      define __PDP_ENDIAN    PDP_ENDIAN

-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__) || defined(__FreeBSD__)

 #      include <sys/endian.h>

-#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+#elif defined(__NetBSD__) || defined(__DragonFly__)

 #      include <sys/endian.h>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions