Define _GNU_SOURCE once for whole codebase 39/190539/7
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Wed, 3 Oct 2018 11:59:18 +0000 (13:59 +0200)
committerKarol Lewandowski <lmctl@lmctl.net>
Wed, 7 Nov 2018 22:43:39 +0000 (23:43 +0100)
There is no need to repeat this in every file.

Change-Id: Ia788840d819b8d72122296a5e5d64aa2a7c3cb40

CMakeLists.txt
src/crash-manager/crash-manager.c
src/crash-manager/dbus_notify.c
src/crash-stack/CMakeLists.txt
src/crash-stack/crash-stack.c
src/shared/util.c
src/sys-assert/arm/backtrace.c
src/sys-assert/arm_64/backtrace.c
src/sys-assert/sys-assert.c
src/sys-assert/x86/backtrace.c
src/sys-assert/x86/context.c

index 9834ed5..9f3222d 100644 (file)
@@ -3,7 +3,7 @@ PROJECT(crash-worker C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
+ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE=1)
 
 # Sub modules
 ADD_SUBDIRECTORY(src/crash-manager)
index 95cbf8b..c48e29a 100644 (file)
@@ -16,8 +16,6 @@
  * limitations under the License.
  */
 
-#define _GNU_SOURCE
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdbool.h>
index 6a8c5d8..cf78f6a 100644 (file)
@@ -16,7 +16,6 @@
  * Author: Mateusz Moscicki <m.moscicki2@partner.samsung.com>
  */
 
-#define _GNU_SOURCE
 #include <gio/gio.h>
 #include <stdio.h>
 #include <unistd.h>
index fd26fac..f996da9 100644 (file)
@@ -21,7 +21,7 @@ else()
   set(CRASH_STACK_SRCS ${CRASH_STACK_SRCS} crash-stack-stub.c)
 endif()
 
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIE -D_GNU_SOURCE=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIE")
 set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 
 # Binary
index a348067..00e2f3f 100644 (file)
@@ -17,7 +17,6 @@
  *         Łukasz Stelmach <l.stelmach@samsung.com>
  *         Rafał Pietruch <r.pietruch@samsung.com>
  */
-#define _GNU_SOURCE 1
 
 /**
  * @file crash-stack.c
index 2367524..775d6be 100644 (file)
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
index 7520bba..2d1241a 100644 (file)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <ucontext.h>
index 3c8f560..21a10d4 100644 (file)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <ucontext.h>
index 75c7c3b..5af44ff 100644 (file)
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-#define _GNU_SOURCE
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
index 0453bbb..4c07d86 100644 (file)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <execinfo.h>
index 5644d15..313ad86 100644 (file)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <ucontext.h>