trunk/makefile
| r243792 | r243793 | |
| 24 | 24 | #------------------------------------------------- |
| 25 | 25 | |
| 26 | 26 | ifndef TARGET |
| 27 | | TARGET = mame |
| 27 | TARGET = ume |
| 28 | 28 | endif |
| 29 | 29 | |
| 30 | 30 | ifndef SUBTARGET |
| r243792 | r243793 | |
| 182 | 182 | # ARCHOPTS = -mcpu=G4 # optimize for G4 |
| 183 | 183 | # note that we leave this commented by default so that you can |
| 184 | 184 | # configure this in your environment and never have to think about it |
| 185 | | # ARCHOPTS = |
| 185 | ARCHOPTS = -march=native |
| 186 | 186 | |
| 187 | NOWERROR=1 |
| 187 | 188 | |
| 188 | 189 | |
| 189 | 190 | #------------------------------------------------- |
| r243792 | r243793 | |
| 221 | 222 | #------------------------------------------------- |
| 222 | 223 | |
| 223 | 224 | # uncomment next line if you are building for a 64-bit target |
| 224 | | # PTR64 = 1 |
| 225 | PTR64 = 1 |
| 225 | 226 | |
| 226 | 227 | # uncomment next line if you are building for a big-endian target |
| 227 | 228 | # BIGENDIAN = 1 |
| r243792 | r243793 | |
| 286 | 287 | |
| 287 | 288 | # specify optimization level or leave commented to use the default |
| 288 | 289 | # (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols) |
| 289 | | # OPTIMIZE = 3 |
| 290 | OPTIMIZE = 3 |
| 290 | 291 | |
| 292 | USE_NETWORK = 1 |
| 291 | 293 | |
| 292 | 294 | ########################################################################### |
| 293 | 295 | ################## END USER-CONFIGURABLE OPTIONS ###################### |
| r243792 | r243793 | |
| 363 | 365 | |
| 364 | 366 | # compiler, linker and utilities |
| 365 | 367 | ifneq ($(TARGETOS),emscripten) |
| 366 | | AR = @ar |
| 367 | | CC = @gcc |
| 368 | | LD = @g++ |
| 368 | AR = ar |
| 369 | CC = gcc |
| 370 | LD = g++ |
| 369 | 371 | endif |
| 370 | | MD = -mkdir$(BUILD_EXE) |
| 371 | | RM = @rm -f |
| 372 | | OBJDUMP = @objdump |
| 373 | | PYTHON = @python |
| 372 | MD = mkdir$(EXE) |
| 373 | RM = rm -f |
| 374 | OBJDUMP = objdump |
| 375 | PYTHON = python2 |
| 374 | 376 | |
| 375 | 377 | #------------------------------------------------- |
| 376 | 378 | # form the name of the executable |
| r243792 | r243793 | |
| 395 | 397 | |
| 396 | 398 | # 64-bit builds get a '64' suffix |
| 397 | 399 | ifeq ($(PTR64),1) |
| 398 | | SUFFIX64 = 64 |
| 400 | SUFFIX64 = |
| 399 | 401 | endif |
| 400 | 402 | |
| 401 | 403 | # debug builds just get the 'd' suffix and nothing more |
| r243792 | r243793 | |
| 475 | 477 | ifdef DEBUG |
| 476 | 478 | DEFS += -DMAME_DEBUG |
| 477 | 479 | else |
| 478 | | DEFS += -DNDEBUG |
| 480 | #DEFS += -DNDEBUG |
| 479 | 481 | endif |
| 480 | 482 | |
| 481 | 483 | # define MAME_PROFILER if we are a profiling build |
| r243792 | r243793 | |
| 565 | 567 | endif |
| 566 | 568 | |
| 567 | 569 | # add the optimization flag |
| 568 | | CCOMFLAGS += -O$(OPTIMIZE) |
| 570 | OPT= -O$(OPTIMIZE) |
| 571 | CCOMFLAGS += $(OPT) |
| 572 | #CCOMFLAGS += -g$(SYMLEVEL) -fno-omit-frame-pointer |
| 569 | 573 | |
| 570 | 574 | # add the error warning flag |
| 571 | 575 | ifndef NOWERROR |
| r243792 | r243793 | |
| 664 | 668 | |
| 665 | 669 | # LDFLAGS are used generally; LDFLAGSEMULATOR are additional |
| 666 | 670 | # flags only used when linking the core emulator |
| 667 | | LDFLAGS = |
| 671 | LDFLAGS = -g |
| 668 | 672 | ifneq ($(TARGETOS),macosx) |
| 669 | 673 | ifneq ($(TARGETOS),os2) |
| 670 | 674 | ifneq ($(TARGETOS),solaris) |
| r243792 | r243793 | |
| 682 | 686 | # strip symbols and other metadata in non-symbols and non profiling builds |
| 683 | 687 | ifndef SYMBOLS |
| 684 | 688 | ifneq ($(TARGETOS),macosx) |
| 685 | | LDFLAGS += -s |
| 689 | LDFLAGS += |
| 686 | 690 | endif |
| 687 | 691 | endif |
| 688 | 692 | |
| r243792 | r243793 | |
| 887 | 891 | maketree: $(sort $(OBJDIRS)) |
| 888 | 892 | |
| 889 | 893 | clean: $(OSDCLEAN) |
| 890 | | @echo Deleting object tree $(OBJ)... |
| 891 | 894 | $(RM) -r $(OBJ) |
| 892 | | @echo Deleting $(EMULATOR)... |
| 893 | 895 | $(RM) $(EMULATOR) |
| 894 | | @echo Deleting $(TOOLS)... |
| 895 | 896 | $(RM) $(TOOLS) |
| 896 | 897 | @echo Deleting dependencies... |
| 897 | 898 | $(RM) depend_emu.mak |
| r243792 | r243793 | |
| 899 | 900 | $(RM) depend_mess.mak |
| 900 | 901 | $(RM) depend_ume.mak |
| 901 | 902 | ifdef MAP |
| 902 | | @echo Deleting $(FULLNAME).map... |
| 903 | 903 | $(RM) $(FULLNAME).map |
| 904 | 904 | endif |
| 905 | 905 | ifdef SYMBOLS |
| r243792 | r243793 | |
| 972 | 972 | #------------------------------------------------- |
| 973 | 973 | |
| 974 | 974 | $(OBJ)/%.o: $(SRC)/%.c | $(OSPREBUILD) |
| 975 | | @echo Compiling $<... |
| 976 | 975 | $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@ |
| 977 | 976 | ifdef CPPCHECK |
| 978 | 977 | @$(CPPCHECK) $(CPPCHECKFLAGS) $< |
| r243792 | r243793 | |
| 986 | 985 | endif |
| 987 | 986 | |
| 988 | 987 | $(OBJ)/%.pp: $(SRC)/%.c | $(OSPREBUILD) |
| 989 | | @echo Compiling $<... |
| 990 | 988 | $(CC) $(CDEFS) $(CFLAGS) -E $< -o $@ |
| 991 | 989 | ifdef CPPCHECK |
| 992 | 990 | @$(CPPCHECK) $(CPPCHECKFLAGS) $< |
| 993 | 991 | endif |
| 994 | 992 | |
| 995 | 993 | $(OBJ)/%.s: $(SRC)/%.c | $(OSPREBUILD) |
| 996 | | @echo Compiling $<... |
| 997 | 994 | $(CC) $(CDEFS) $(CFLAGS) -S $< -o $@ |
| 998 | 995 | ifdef CPPCHECK |
| 999 | 996 | @$(CPPCHECK) $(CPPCHECKFLAGS) $< |
| r243792 | r243793 | |
| 1029 | 1026 | @cp $< $@ |
| 1030 | 1027 | else |
| 1031 | 1028 | $(OBJ)/%.a: |
| 1032 | | @echo Archiving $@... |
| 1033 | 1029 | $(RM) $@ |
| 1034 | 1030 | $(AR) $(ARFLAGS) $@ $^ |
| 1035 | 1031 | endif |
| 1036 | 1032 | |
| 1033 | $(OBJ)/%.so: |
| 1034 | $(RM) $@ |
| 1035 | $(AR) $(ARFLAGS) $@ $^ |
| 1036 | # $(CC) -shared -o $@ $^ |
| 1037 | |
| 1037 | 1038 | ifeq ($(TARGETOS),macosx) |
| 1038 | 1039 | $(OBJ)/%.o: $(SRC)/%.m | $(OSPREBUILD) |
| 1039 | 1040 | @echo Objective-C compiling $<... |
trunk/src/emu/emucore.h
| r243792 | r243793 | |
| 218 | 218 | #undef assert |
| 219 | 219 | #undef assert_always |
| 220 | 220 | |
| 221 | | #ifdef MAME_DEBUG |
| 222 | 221 | #define assert(x) do { if (!(x)) throw emu_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0) |
| 223 | 222 | #define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0) |
| 224 | | #else |
| 225 | | #define assert(x) do { } while (0) |
| 226 | | #define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0) |
| 227 | | #endif |
| 228 | 223 | |
| 229 | 224 | |
| 230 | 225 | // macros to convert radians to degrees and degrees to radians |
| r243792 | r243793 | |
| 316 | 311 | template<class _Dest, class _Source> |
| 317 | 312 | inline _Dest downcast(_Source *src) |
| 318 | 313 | { |
| 319 | | #if defined(MAME_DEBUG) && !defined(MAME_DEBUG_FAST) |
| 320 | 314 | try { |
| 321 | 315 | if (dynamic_cast<_Dest>(src) != src) |
| 322 | 316 | { |
| r243792 | r243793 | |
| 330 | 324 | { |
| 331 | 325 | report_bad_cast(typeid(src), typeid(_Dest)); |
| 332 | 326 | } |
| 333 | | #endif |
| 334 | 327 | return static_cast<_Dest>(src); |
| 335 | 328 | } |
| 336 | 329 | |
| 337 | 330 | template<class _Dest, class _Source> |
| 338 | 331 | inline _Dest downcast(_Source &src) |
| 339 | 332 | { |
| 340 | | #if defined(MAME_DEBUG) && !defined(MAME_DEBUG_FAST) |
| 341 | 333 | try { |
| 342 | 334 | if (&dynamic_cast<_Dest>(src) != &src) |
| 343 | 335 | { |
| r243792 | r243793 | |
| 351 | 343 | { |
| 352 | 344 | report_bad_cast(typeid(src), typeid(_Dest)); |
| 353 | 345 | } |
| 354 | | #endif |
| 355 | 346 | return static_cast<_Dest>(src); |
| 356 | 347 | } |
| 357 | 348 | |
trunk/src/osd/modules/netdev/taptun.c
| r243792 | r243793 | |
| 57 | 57 | { |
| 58 | 58 | #ifdef __linux__ |
| 59 | 59 | struct ifreq ifr; |
| 60 | | |
| 61 | 60 | m_fd = -1; |
| 62 | 61 | if((m_fd = open("/dev/net/tun", O_RDWR)) == -1) { |
| 63 | 62 | osd_printf_verbose("tap: open failed %d\n", errno); |
| r243792 | r243793 | |
| 66 | 65 | |
| 67 | 66 | memset(&ifr, 0, sizeof(ifr)); |
| 68 | 67 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
| 69 | | sprintf(ifr.ifr_name, "tap-mess-%d-0", getuid()); |
| 68 | sprintf(ifr.ifr_name, "mess0"); |
| 70 | 69 | if(ioctl(m_fd, TUNSETIFF, (void *)&ifr) == -1) { |
| 71 | 70 | osd_printf_verbose("tap: ioctl failed %d\n", errno); |
| 72 | 71 | close(m_fd); |