Bug 1399679 - Arrange some includes such that linux/posix_types.h is included before sys/select.h draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 27 Dec 2017 11:30:33 +0900
changeset 722004 2068b1b7c07de99f32911c375fddbdb79f56656d
parent 722003 363d1661518a729d4c2e3933db0f4b60fa4161bd
child 722005 3c9bb7785ea41840af834554359aea333ace2a0e
push id96025
push userbmo:mh+mozilla@glandium.org
push dateThu, 18 Jan 2018 09:37:19 +0000
bugs1399679
milestone59.0a1
Bug 1399679 - Arrange some includes such that linux/posix_types.h is included before sys/select.h The FD_SET/FD_CLR/FD_ZERO/FD_ISSET macros, when you look all the way down, are defined depending on a _FDMASK or __FDMASK and a _NFDBITS or __NFDBITS macro. As described in sys/select.h, "Some versions of <linux/posix_types.h> define these macros", and that's the case on CentOS 6. That's however not the case on Debian wheezy. sys/select.h has, following that comment, some #undef's to remove those definitions, but when linux/posix_types.h is included afterwards, its definitions take precedence. Interestingly, while their effect is the same, the definitions are not exactly the same between sys/select.h and linux/posix_types.h on CentOS 6, and depending on which is included first, codegen can be slightly different. So we arrange for the definitions in sys/select.h to be picked.
ipc/chromium/src/third_party/libevent/http.c
media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
--- a/ipc/chromium/src/third_party/libevent/http.c
+++ b/ipc/chromium/src/third_party/libevent/http.c
@@ -23,35 +23,35 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "event2/event-config.h"
 #include "evconfig-private.h"
 
+#ifdef EVENT__HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
 #ifdef EVENT__HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
 #ifdef EVENT__HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
 
 #ifdef HAVE_SYS_IOCCOM_H
 #include <sys/ioccom.h>
 #endif
 #ifdef EVENT__HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
 #ifdef EVENT__HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
-#ifdef EVENT__HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
 
 #ifndef _WIN32
 #include <sys/socket.h>
 #include <sys/stat.h>
 #else
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #endif
--- a/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
@@ -3,16 +3,17 @@
  *
  *  Use of this source code is governed by a BSD-style license
  *  that can be found in the LICENSE file in the root of the source
  *  tree. An additional intellectual property rights grant can be found
  *  in the file PATENTS.  All contributing project authors may
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <linux/types.h>
 #include "webrtc/modules/video_capture/linux/device_info_linux.h"
 
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>