diff --git a/configure b/configure
index 955a5686841864d29a03a500a1a8f1c515b4291c..40f30ddbb626d4c16c0d3567d6e7a12a449564d9 100755
--- a/configure
+++ b/configure
@@ -1664,7 +1664,7 @@ LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
 CC_O='-o $@'
 
-host_cflags='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall'
+host_cflags='-D_ISOC99_SOURCE -O3 -g -Wall'
 host_libs='-lm'
 
 target_path='$(CURDIR)'
@@ -2316,7 +2316,7 @@ if test "$?" != 0; then
     die "C compiler test failed."
 fi
 
-add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
+add_cppflags -D_ISOC99_SOURCE
 check_cflags -std=c99
 check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
 #include <stdlib.h>
@@ -2364,7 +2364,6 @@ case $target_os in
         disable symver
         oss_indev_extralibs="-lossaudio"
         oss_outdev_extralibs="-lossaudio"
-        add_cppflags -D_XOPEN_SOURCE=600
         ;;
     openbsd)
         enable malloc_aligned
@@ -2457,6 +2456,7 @@ case $target_os in
         enable dos_paths
         ;;
     linux)
+        add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
         enable dv1394
         ;;
     irix*)
diff --git a/doc/general.texi b/doc/general.texi
index 53482273f930201d200c09f00af5d7ab3d8f0bc5..ce531ccdfba2dce7ead7608cdebde85632ed53cd 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -785,14 +785,6 @@ to configure.
 BSD make will not build Libav, you need to install and use GNU Make
 (@file{gmake}).
 
-@subsubsection FreeBSD, DragonFly BSD
-
-These systems will not compile out-of-the-box due to broken system headers.
-Passing @code{--extra-cflags=-D__BSD_VISIBLE} to configure will work
-around the problem. This may have unexpected sideeffects, so use it at
-your own risk. If you care about FreeBSD, please make an attempt at
-getting the system headers fixed.
-
 @subsection (Open)Solaris
 
 GNU Make is required to build Libav, so you have to invoke (@file{gmake}),
diff --git a/ffmpeg.c b/ffmpeg.c
index 5ab3c7a508d02ec66b0ac7d48916086318b3377c..b5ff4cfc30df27661cae6e7dcbc7eb551048013c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -19,9 +19,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-/* needed for usleep() */
-#define _XOPEN_SOURCE 600
-
 #include "config.h"
 #include <ctype.h>
 #include <string.h>
diff --git a/ffplay.c b/ffplay.c
index 07727b667a2cc672d6116c15d02f19cdec883335..e820c603e37e75b6ec6f724e624e792f77536d55 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -19,8 +19,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#define _XOPEN_SOURCE 600
-
 #include "config.h"
 #include <inttypes.h>
 #include <math.h>
diff --git a/ffserver.c b/ffserver.c
index fe030b94c02880942f2cb9b2960f7b9ce23ff806..b4613af8feba66a692ebee9da14acbe4cdac3489 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -19,8 +19,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#define _XOPEN_SOURCE 600
-
 #include "config.h"
 #if !HAVE_CLOSESOCKET
 #define closesocket close
diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c
index 96ce84872b48d1e2d1361cda662660be6557dcb6..1e887a2a8c4fc44b64a2c3b9f39c09e7e32bc5b5 100644
--- a/libavcodec/libxvidff.c
+++ b/libavcodec/libxvidff.c
@@ -25,9 +25,6 @@
  * @author Adam Thayer (krevnik@comcast.net)
  */
 
-/* needed for mkstemp() */
-#define _XOPEN_SOURCE 600
-
 #include <xvid.h>
 #include <unistd.h>
 #include "avcodec.h"
diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c
index ab70a1b2b7e9e8f7002ed5945a5c4a75ee8baa08..dad5c834f110e05f53d64749ea5daceca0e2f969 100644
--- a/libavdevice/bktr.c
+++ b/libavdevice/bktr.c
@@ -24,10 +24,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#define _BSD_SOURCE 1
-#define _NETBSD_SOURCE
-#define _XOPEN_SOURCE 600
-
 #include "libavformat/avformat.h"
 #if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H
 # include <dev/bktr/ioctl_meteor.h>
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index aaad7292c6a9d622f4326f9d708fd57b836b3e0d..0e63d09feabb9a46b183e03c576febcafb3539fb 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -35,8 +35,6 @@
  * and Edouard Gomez <ed.gomez@free.fr>.
  */
 
-#define _XOPEN_SOURCE 600
-
 #include "config.h"
 #include "libavformat/avformat.h"
 #include <time.h>
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 822d80bb000452c66ba0214e51be93e1acc584fb..e3b1500044f5872614638b8ebcb404186b98ec70 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -25,7 +25,6 @@
  * http://tools.ietf.org/html/draft-pantos-http-live-streaming
  */
 
-#define _XOPEN_SOURCE 600
 #include "libavutil/avstring.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/opt.h"
diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c
index 37b289a1e071cdd71c026af6d74165f8efc2949b..85f3cfcef43761b2cd932068d296a876e5adbd22 100644
--- a/libavformat/applehttpproto.c
+++ b/libavformat/applehttpproto.c
@@ -25,7 +25,6 @@
  * http://tools.ietf.org/html/draft-pantos-http-live-streaming
  */
 
-#define _XOPEN_SOURCE 600
 #include "libavutil/avstring.h"
 #include "avformat.h"
 #include "internal.h"
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 0702aff0077dcab9f260359afc8422584fdce31f..8881f269f25a7f2b6539f989e24fe7eea5c9b09a 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -19,9 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-/* needed for usleep() */
-#define _XOPEN_SOURCE 600
 #include <unistd.h>
+
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
 #include "os_support.h"
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 05577b7553f7da8ba673f2c3af4c8e678421208a..a0fcd6c9ba2be4b0dbcc476f6c53587345cc1152 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -22,7 +22,6 @@
 
 /* needed by inet_aton() */
 #define _SVID_SOURCE
-#define _DARWIN_C_SOURCE
 
 #include "config.h"
 #include "avformat.h"
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 43305a30c794543a1b59586f1252dd6c877a84b9..4623088c382bb1aa247ecdd89f4a1e1713d80f4f 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -19,9 +19,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-/* needed for gethostname() */
-#define _XOPEN_SOURCE 600
-
 #include "libavcodec/get_bits.h"
 #include "avformat.h"
 #include "mpegts.h"
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 62c1c7c107a373e966afafffdfc1e6a8e6a37051..d6522bf0be9d2f81cb6e83fd79db981136937d22 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -25,7 +25,7 @@
  */
 
 #define _BSD_SOURCE     /* Needed for using struct ip_mreq with recent glibc */
-#define _DARWIN_C_SOURCE /* Needed for using IP_MULTICAST_TTL on OS X */
+
 #include "avformat.h"
 #include "avio_internal.h"
 #include "libavutil/parseutils.h"
diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 6b122ed8c4347a4ae52554766b6ed5d40d8d08c3..002571161a757458882902378dde4b2e0592e133 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -17,10 +17,8 @@
  */
 
 #ifdef __APPLE__
-#undef _POSIX_C_SOURCE
 #include <sys/sysctl.h>
 #elif defined(__OpenBSD__)
-#undef _POSIX_C_SOURCE
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #include <machine/cpu.h>
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 818d014159148a66f47b9168eef0a38586b40b51..e9319fa67b387a8ab0f9e03f52206950d6d97623 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -18,8 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#define _SVID_SOURCE //needed for MAP_ANONYMOUS
-#define _DARWIN_C_SOURCE // needed for MAP_ANON
 #include <inttypes.h>
 #include <string.h>
 #include <math.h>