Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-954

PHP extension not compiling under FreeBSD

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 0.4
    • Fix Version/s: 0.4
    • Component/s: PHP - Library
    • Labels:
      None
    • Environment:

      FreeBSD 7.2-RELEASE amd64

      Description

      When trying to compile the Thrift 0.4 PHP extension under FreeBSD 7.2-RELEASE amd64, I faced these errors when running 'make' :

      php_thrift_protocol.cpp:27:20: error: endian.h: No such file or directory
      php_thrift_protocol.cpp:28:22: error: byteswap.h: No such file or directory
      php_thrift_protocol.cpp:466: error: 'bswap_64' was not declared in this scope
      php_thrift_protocol.cpp:474: error: 'bswap_64' was not declared in this scope

      Here's the changes that allowed me to successfully compile it :

      php_thrift_protocol.cpp:

      #include <sys/types.h>
      #include <netinet/in.h>
      #include <unistd.h>
      #include <sys/endian.h> // <-- was endian.h
      // #include <byteswap.h> // <-- doesn't exist under FreeBSD
      #include <stdexcept>

      #if __BYTE_ORDER == __LITTLE_ENDIAN
      #define htonll bswap64 // <-- was bswap_64
      #define ntohll bswap64 // <-- was bswap_64
      #else
      #define htonll x
      #define ntohll x
      #endif

      The lines that changed are the ones marked with "<--".

      Please let me know if there's a better way to achieve this.

        Attachments

        1. diff.txt
          0.4 kB
          Mike Nadeau

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              akaris Mike Nadeau
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: