mirror of
https://github.com/linux-sunxi/sunxi-tools.git
synced 2024-11-27 11:54:29 +08:00
Makefile: Have portable_endian.h properly expose all functions
For Linux, this requires additional #defines, see https://gist.github.com/panzi/6856583#gistcomment-1656524 Placing those #defines into portable_endian.h would mean we depend on the specific order of #includes (whatever pulls in endian.h first, including other system includes). Avoid this by using symbols provided "globally" via the Makefile. Also nuke the _NETBSD_SOURCE definition in fel.c Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
This commit is contained in:
parent
d47c3a3649
commit
73c20eea7b
9
Makefile
9
Makefile
@ -18,9 +18,16 @@
|
|||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -g -O0 -Wall -Wextra
|
CFLAGS = -g -O0 -Wall -Wextra
|
||||||
CFLAGS += -std=c99 -D_POSIX_C_SOURCE=200112L
|
CFLAGS += -std=c99 $(DEFINES)
|
||||||
CFLAGS += -Iinclude/
|
CFLAGS += -Iinclude/
|
||||||
|
|
||||||
|
DEFINES = -D_POSIX_C_SOURCE=200112L
|
||||||
|
# Define _BSD_SOURCE, necessary to expose all endian conversions properly.
|
||||||
|
# See http://linux.die.net/man/3/endian
|
||||||
|
DEFINES += -D_BSD_SOURCE
|
||||||
|
# glibc 2.20+ also requires _DEFAULT_SOURCE
|
||||||
|
DEFINES += -D_DEFAULT_SOURCE
|
||||||
|
|
||||||
# Tools useful on host and target
|
# Tools useful on host and target
|
||||||
TOOLS = sunxi-fexc sunxi-bootinfo sunxi-fel sunxi-nand-part
|
TOOLS = sunxi-fexc sunxi-bootinfo sunxi-fel sunxi-nand-part
|
||||||
|
|
||||||
|
6
fel.c
6
fel.c
@ -15,12 +15,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Needs _BSD_SOURCE for htole and letoh */
|
|
||||||
/* glibc 2.20+ also requires _DEFAULT_SOURCE */
|
|
||||||
#define _DEFAULT_SOURCE
|
|
||||||
#define _BSD_SOURCE
|
|
||||||
#define _NETBSD_SOURCE
|
|
||||||
|
|
||||||
#include <libusb.h>
|
#include <libusb.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -15,11 +15,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Needs _BSD_SOURCE for htole and letoh */
|
|
||||||
/* glibc 2.20+ also requires _DEFAULT_SOURCE */
|
|
||||||
#define _DEFAULT_SOURCE
|
|
||||||
#define _BSD_SOURCE
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
5
pio.c
5
pio.c
@ -17,11 +17,6 @@
|
|||||||
* MA 02111-1307 USA
|
* MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* needs _BSD_SOURCE for htole and letoh */
|
|
||||||
/* glibc 2.20+ also requires _DEFAULT_SOURCE */
|
|
||||||
#define _DEFAULT_SOURCE
|
|
||||||
#define _BSD_SOURCE
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user