Skip to content

Commit

Permalink
Fix FreeBSD build
Browse files Browse the repository at this point in the history
Fix the FreeBSD build by defining the appropriate
C preprocessor macros such that the libc headers
define prototypes for the functions used.
  • Loading branch information
ndim committed Feb 1, 2024
1 parent 67ae87e commit 846ae9f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion camlibs/kodak/dc120/dc120.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@

#include "config.h"

/* Must be included before including unistd.h to define _XOPEN_SOURCE
before unistd.h on FreeBSD. */
#include <gphoto2/gphoto2-port-portability.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <unistd.h>

#include <gphoto2/gphoto2.h>
#include <gphoto2/gphoto2-port.h>
Expand Down
4 changes: 4 additions & 0 deletions camlibs/kodak/dc120/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#define _POSIX_C_SOURCE 199309L
#include "config.h"

/* Must be included before including unistd.h to define _XOPEN_SOURCE
before unistd.h on FreeBSD. */
#include <gphoto2/gphoto2-port-portability.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
4 changes: 4 additions & 0 deletions camlibs/panasonic/coolshot/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

#include "config.h"

/* Must be included before including unistd.h to define _XOPEN_SOURCE
before unistd.h on FreeBSD. */
#include <gphoto2/gphoto2-port-portability.h>

#include <stdio.h>
#include <string.h>
#include <gphoto2/gphoto2.h>
Expand Down
1 change: 1 addition & 0 deletions camlibs/ptp2/fujiptpip.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#else
# include <sys/socket.h>
# include <netinet/in.h>
# include <arpa/inet.h>
#endif
#include "ptpip-private.h"

Expand Down
1 change: 1 addition & 0 deletions camlibs/ptp2/ptpip.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#else
# include <sys/socket.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <fcntl.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion camlibs/st2205/st2205.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Boston, MA 02110-1301 USA
*/
#define _DEFAULT_SOURCE
#define _POSIX_C_SOURCE 1
#define _POSIX_C_SOURCE 199506
#define _DARWIN_C_SOURCE
#include "config.h"

Expand Down

0 comments on commit 846ae9f

Please sign in to comment.