diff --git a/gfx/qcms/Makefile.in b/gfx/qcms/Makefile.in --- a/gfx/qcms/Makefile.in +++ b/gfx/qcms/Makefile.in @@ -17,8 +17,12 @@ CSRCS = iccread.c transform.c FORCE_STATIC_LIB = 1 # This library is used by other shared libs FORCE_USE_PIC = 1 include $(topsrcdir)/config/rules.mk CFLAGS += -DMOZ_QCMS + +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qenum=4 -qlanglvl=extc99 +endif diff --git a/gfx/qcms/qcmsint.h b/gfx/qcms/qcmsint.h --- a/gfx/qcms/qcmsint.h +++ b/gfx/qcms/qcmsint.h @@ -55,17 +55,17 @@ typedef uint16_t uInt16Number; struct XYZNumber { s15Fixed16Number X; s15Fixed16Number Y; s15Fixed16Number Z; }; struct curveType { uint32_t count; - uInt16Number data[0]; + uInt16Number data[]; }; struct lutType { uint8_t num_input_channels; uint8_t num_output_channels; uint8_t num_clut_grid_points; s15Fixed16Number e00; diff --git a/gfx/qcms/qcmstypes.h b/gfx/qcms/qcmstypes.h --- a/gfx/qcms/qcmstypes.h +++ b/gfx/qcms/qcmstypes.h @@ -5,16 +5,18 @@ #include "prtypes.h" /* prtypes.h defines IS_LITTLE_ENDIAN and IS_BIG ENDIAN */ #if defined (__SVR4) && defined (__sun) /* int_types.h gets included somehow, so avoid redefining the types differently */ #include +#elif defined (_AIX) +#include #else typedef PRInt8 int8_t; typedef PRUint8 uint8_t; typedef PRInt16 int16_t; typedef PRUint16 uint16_t; typedef PRInt32 int32_t; typedef PRUint32 uint32_t; typedef PRInt64 int64_t; @@ -65,17 +67,17 @@ typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #ifdef _WIN64 typedef unsigned __int64 uintptr_t; #else typedef unsigned long uintptr_t; #endif #elif defined (_AIX) -# include +# include #else # include #endif #endif typedef qcms_bool bool; #define true 1 diff --git a/gfx/src/thebes/nsThebesDeviceContext.cpp b/gfx/src/thebes/nsThebesDeviceContext.cpp --- a/gfx/src/thebes/nsThebesDeviceContext.cpp +++ b/gfx/src/thebes/nsThebesDeviceContext.cpp @@ -192,17 +192,17 @@ nsThebesDeviceContext::SetDPI() if (NS_FAILED(rv)) { prefDPI = -1; } } #if defined(MOZ_ENABLE_GTK2) GdkScreen *screen = gdk_screen_get_default(); gtk_settings_get_for_screen(screen); // Make sure init is run so we have a resolution - PRInt32 OSVal = PRInt32(round(gdk_screen_get_resolution(screen))); + PRInt32 OSVal = PRInt32(rint(gdk_screen_get_resolution(screen))); if (prefDPI == 0) // Force the use of the OS dpi dpi = OSVal; else // Otherwise, the minimum dpi is 96dpi dpi = PR_MAX(OSVal, 96); #elif defined(XP_WIN) // XXX we should really look at the widget if !dc but it is currently always null diff --git a/gfx/thebes/src/Makefile.in b/gfx/thebes/src/Makefile.in --- a/gfx/thebes/src/Makefile.in +++ b/gfx/thebes/src/Makefile.in @@ -186,8 +186,11 @@ endif ifeq ($(MOZ_WIDGET_TOOLKIT),os2) CXXFLAGS += $(CAIRO_FT_CFLAGS) endif ifeq ($(MOZ_WIDGET_TOOLKIT),qt) CXXFLAGS += $(CAIRO_FT_CFLAGS) endif +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qlanglvl=extc99 +endif diff --git a/gfx/thebes/src/gfxFont.cpp b/gfx/thebes/src/gfxFont.cpp --- a/gfx/thebes/src/gfxFont.cpp +++ b/gfx/thebes/src/gfxFont.cpp @@ -1758,17 +1758,17 @@ gfxTextRun::AdjustAdvancesForSyntheticBo glyphData->SetComplex(PR_TRUE, PR_TRUE, 1); DetailedGlyph detail = {glyphIndex, advance, 0, 0}; SetGlyphs(i, *glyphData, &detail); } } else { // complex glyphs ==> add offset at cluster/ligature boundaries PRUint32 detailedLength = glyphData->GetGlyphCount(); if (detailedLength && mDetailedGlyphs) { - gfxTextRun::DetailedGlyph *details = mDetailedGlyphs[i].get(); + gfxTextRun::DetailedGlyph *details = (mDetailedGlyphs.get())[i].get(); if (!details) continue; if (isRTL) details[0].mAdvance += synAppUnitOffset; else details[detailedLength - 1].mAdvance += synAppUnitOffset; } } } diff --git a/js/jsd/Makefile.in b/js/jsd/Makefile.in --- a/js/jsd/Makefile.in +++ b/js/jsd/Makefile.in @@ -102,8 +102,12 @@ FORCE_SHARED_LIB= MODULE_NAME = JavaScript_Debugger EXPORT_LIBRARY = 1 endif endif include $(topsrcdir)/config/rules.mk DEFINES += -DEXPORT_JSD_API + +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qlanglvl=extc99 +endif diff --git a/js/src/liveconnect/Makefile.in b/js/src/liveconnect/Makefile.in --- a/js/src/liveconnect/Makefile.in +++ b/js/src/liveconnect/Makefile.in @@ -97,9 +97,12 @@ EXPORTS = \ EXTRA_DSO_LDOPTS += \ $(LIBS_DIR) \ $(MOZ_JS_LIBS) \ $(MOZ_COMPONENT_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qlanglvl=extc99 +endif diff --git a/media/libfishsound/src/libfishsound/Makefile.in b/media/libfishsound/src/libfishsound/Makefile.in --- a/media/libfishsound/src/libfishsound/Makefile.in +++ b/media/libfishsound/src/libfishsound/Makefile.in @@ -51,8 +51,12 @@ CSRCS = \ fishsound.c \ fs_vector.c \ fishsound_speex.c \ fishsound_vorbis.c \ fishsound_flac.c \ $(NULL) include $(topsrcdir)/config/rules.mk + +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qlanglvl=extc99 +endif diff --git a/media/libfishsound/src/libfishsound/debug.h b/media/libfishsound/src/libfishsound/debug.h --- a/media/libfishsound/src/libfishsound/debug.h +++ b/media/libfishsound/src/libfishsound/debug.h @@ -24,16 +24,20 @@ /* MSVC can't handle C99 */ #if (defined (_MSCVER) || defined (_MSC_VER)) #define debug_printf // #else #ifdef DEBUG #ifndef DEBUG_LEVEL #define DEBUG_LEVEL 1 +#ifdef AIX +#undef DEBUG_LEVEL 1 +#define DEBUG_LEVEL 0 +#endif #endif #endif #if (DEBUG_LEVEL > 0) #define DEBUG_MAXLINE 4096 #include @@ -78,15 +82,17 @@ debug_print_err (const char * func, int * debug_printf (level, fmt) * * Print a formatted debugging message of level 'level' to stderr */ #define debug_printf(x,y...) {if (x <= DEBUG_LEVEL) debug_print_err (__func__, __LINE__, y);} #undef MAXLINE +#elif defined AIX +#define debug_printf /* */ #else #define debug_printf(x,y...) #endif #endif /* non-C99 */ #endif /* __DEBUG_H__ */ diff --git a/media/liboggplay/src/liboggplay/Makefile.in b/media/liboggplay/src/liboggplay/Makefile.in --- a/media/liboggplay/src/liboggplay/Makefile.in +++ b/media/liboggplay/src/liboggplay/Makefile.in @@ -74,8 +74,12 @@ EXPORTS += \ $(NULL) CSRCS += \ os2_semaphore.c \ $(NULL) endif include $(topsrcdir)/config/rules.mk + +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qlanglvl=extc99 +endif diff --git a/media/liboggplay/src/liboggplay/oggplay_data.c b/media/liboggplay/src/liboggplay/oggplay_data.c --- a/media/liboggplay/src/liboggplay/oggplay_data.c +++ b/media/liboggplay/src/liboggplay/oggplay_data.c @@ -404,17 +404,17 @@ get_uv_offset(OggPlayTheoraDecode *decod if (decode->y_height != 0 && decode->uv_height != 0 && decode->y_height/decode->uv_height != 0) { yo = (buffer->uv_stride)*(decode->video_info.offset_y/(decode->y_height/decode->uv_height)); } return xo + yo; } -int +OggPlayErrorCode oggplay_data_handle_theora_frame (OggPlayTheoraDecode *decode, const yuv_buffer *buffer) { size_t size = sizeof (OggPlayVideoRecord); int i, ret; long y_size, uv_size, y_offset, uv_offset; unsigned char * p; unsigned char * q; diff --git a/media/liboggz/include/oggz/oggz_off_t_generated.h b/media/liboggz/include/oggz/oggz_off_t_generated.h --- a/media/liboggz/include/oggz/oggz_off_t_generated.h +++ b/media/liboggz/include/oggz/oggz_off_t_generated.h @@ -54,17 +54,17 @@
    echo "gcc -E oggz.h | grep oggz_off_t
  
* */ #include -#if defined(__APPLE__) || defined(SOLARIS) || defined(OS2) +#if defined(__APPLE__) || defined(SOLARIS) || defined(OS2) || defined (_AIX) typedef off_t oggz_off_t; #else typedef loff_t oggz_off_t; #endif #define PRI_OGGZ_OFF_T "PRId64" #endif /* __OGGZ_OFF_T_GENERATED__ */ diff --git a/media/liboggz/src/liboggz/Makefile.in b/media/liboggz/src/liboggz/Makefile.in --- a/media/liboggz/src/liboggz/Makefile.in +++ b/media/liboggz/src/liboggz/Makefile.in @@ -57,8 +57,12 @@ CSRCS = \ oggz_seek.c \ oggz_stream.c \ oggz_table.c \ oggz_vector.c \ oggz_write.c \ $(NULL) include $(topsrcdir)/config/rules.mk + +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qlanglvl=extc99 +endif diff --git a/media/liboggz/src/liboggz/dirac.c b/media/liboggz/src/liboggz/dirac.c --- a/media/liboggz/src/liboggz/dirac.c +++ b/media/liboggz/src/liboggz/dirac.c @@ -1,21 +1,22 @@ /* dirac.c */ - -#include "config.h" - -#ifdef HAVE_STDINT_H + +#include "config.h" + +#if defined AIX && HAVE_SYS_INTTYPES_H +#include +#elif defined HAVE_STDINT_H #include -#endif +#endif #include "dirac.h" - typedef struct dirac_bs_s { uint8_t *p_start; uint8_t *p; uint8_t *p_end; int i_left; /* i_count number of available bits */ diff --git a/media/libsydneyaudio/include/sydney_audio.h b/media/libsydneyaudio/include/sydney_audio.h --- a/media/libsydneyaudio/include/sydney_audio.h +++ b/media/libsydneyaudio/include/sydney_audio.h @@ -80,16 +80,18 @@ async-signal safe. # define SA_LITTLE_ENDIAN 1 # endif #elif defined(SOLARIS) # if defined(_BIG_ENDIAN) # define SA_BIG_ENDIAN 1 # else # define SA_LITTLE_ENDIAN 1 # endif +#elif defined(AIX) +# define SA_BIG_ENDIAN 1 #else # error "Cannot determine byte order!" #endif #if defined(WIN32) #if !defined(int32_t) typedef __int32 int32_t; #endif diff --git a/media/libsydneyaudio/src/Makefile.in b/media/libsydneyaudio/src/Makefile.in --- a/media/libsydneyaudio/src/Makefile.in +++ b/media/libsydneyaudio/src/Makefile.in @@ -72,13 +72,23 @@ OS_LIBS += -framework CoreAudio -framewo endif ifeq ($(OS_ARCH),SunOS) CSRCS = \ sydney_audio_sunaudio.c \ $(NULL) endif +ifeq ($(OS_ARCH),AIX) +CSRCS = \ + sydney_audio_aix.c \ + $(NULL) +endif + ifeq ($(OS_ARCH),WINNT) OS_LIBS += winmm.lib endif include $(topsrcdir)/config/rules.mk + +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qlanglvl=extc99 +endif diff --git a/media/libsydneyaudio/src/sydney_audio_aix.c b/media/libsydneyaudio/src/sydney_audio_aix.c new file mode 100644 --- /dev/null +++ b/media/libsydneyaudio/src/sydney_audio_aix.c @@ -0,0 +1,493 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Shailendra N Jain + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sydney_audio.h" + +#ifndef DEFAULT_AUDIO_DEVICE +#define DEFAULT_AUDIO_DEVICE "/dev/paud0/1" +#endif + +#ifdef _AIX43 +#if ! defined _AIX51 +#define AUDIO_PCM PCM +#define AUDIO_TWOS_COMPLEMENT TWOS_COMPLEMENT +#define AUDIO_PLAY PLAY +#define AUDIO_OUTPUT_1 OUTPUT_1 +#endif /* ! _AIX51 */ +#endif /* _AIX43 */ + +#define LOOP_WHILE_EINTR(v,func) do { (v) = (func); } \ + while ((v) == -1 && errno == EINTR); + +typedef struct sa_buf sa_buf; +struct sa_buf { + unsigned int size; /* the size of data */ + sa_buf *next; + unsigned char data[]; /* sound data */ +}; + +struct sa_stream +{ + int audio_fd; + pthread_mutex_t mutex; + pthread_t thread_id; + int playing; + int64_t bytes_played; + + /* audio format info */ + /* default setting */ + unsigned int default_n_channels; + unsigned int default_rate; + unsigned int default_precision; + + /* used settings */ + unsigned int rate; + unsigned int n_channels; + unsigned int precision; + + /* buffer list */ + sa_buf *bl_head; + sa_buf *bl_tail; +}; + +/* Use a default buffer size with enough room for one second of audio, + * assuming stereo data at 44.1kHz with 32 bits per channel, and impose + * a generous limit on the number of buffers. + */ +#define BUF_SIZE (2 * 44100 * 4) + +static void* audio_callback(void* s); + +static sa_buf *new_buffer(int size); + +/* + * ----------------------------------------------------------------------------- + * Startup and shutdown functions + * ----------------------------------------------------------------------------- + */ + +int +sa_stream_create_pcm( + sa_stream_t ** _s, + const char * client_name, + sa_mode_t mode, + sa_pcm_format_t format, + unsigned int rate, + unsigned int n_channels +) +{ + sa_stream_t * s = 0; + + /* Make sure we return a NULL stream pointer on failure. */ + if (_s == NULL) + return SA_ERROR_INVALID; + + *_s = NULL; + + if (mode != SA_MODE_WRONLY) + return SA_ERROR_NOT_SUPPORTED; + + if (format != SA_PCM_FORMAT_S16_LE) + return SA_ERROR_NOT_SUPPORTED; + + /* + * Allocate the instance and required resources. + */ + if ((s = malloc(sizeof(sa_stream_t))) == NULL) + return SA_ERROR_OOM; + + if (pthread_mutex_init(&s->mutex, NULL) != 0) { + free(s); + return SA_ERROR_SYSTEM; + } + + s->audio_fd = NULL; + s->rate = rate; + s->n_channels = n_channels; + s->precision = 16; + + s->playing = 0; + s->bytes_played = 0; + s->bl_tail = s->bl_head = NULL; + + *_s = s; + + return SA_SUCCESS; +} + + +int +sa_stream_open(sa_stream_t *s) +{ + int fd,err; + char *device_name; + + audio_init init; + audio_control control; + audio_change change; + + device_name = DEFAULT_AUDIO_DEVICE; + + if (s == NULL) + return SA_ERROR_NO_INIT; + + if (s->audio_fd != NULL) + return SA_ERROR_INVALID; + + fd = open(device_name,O_WRONLY | O_NONBLOCK); + if (fd >= 0) + { + close (fd); + fd = open (device_name, O_WRONLY); + } + + if ( fd < 0 ) + { + printf("Open %s failed:%s ",device_name,strerror(errno)); + return SA_ERROR_NO_DEVICE; + } + + init.srate = s->rate; + init.channels = s->n_channels; + init.mode = AUDIO_PCM; + init.flags = AUDIO_BIG_ENDIAN | AUDIO_TWOS_COMPLEMENT; + init.operation = AUDIO_PLAY; + + if (ioctl(s->audio_fd, AUDIO_INIT, &init) < 0) { + close(s->audio_fd); + return 0; + } + + change.balance = 0x3fff0000; + change.volume = 0x3fff0000; + change.monitor = AUDIO_IGNORE; + change.input = AUDIO_IGNORE; + change.output = AUDIO_OUTPUT_1; + + control.ioctl_request = AUDIO_CHANGE; + control.position = 0; + control.request_info = &change; + + if (ioctl(s->audio_fd, AUDIO_CONTROL, &control) < 0) { + close(s->audio_fd); + return 0; + } + + control.ioctl_request = AUDIO_START; + control.request_info = NULL; + + if (ioctl(s->audio_fd, AUDIO_CONTROL, &control) < 0) { + close(s->audio_fd); + return 0; + } + + return SA_SUCCESS; +} + +int +sa_stream_destroy(sa_stream_t *s) +{ + int result; + + if (s == NULL) + return SA_SUCCESS; + + + pthread_mutex_lock(&s->mutex); + + result = SA_SUCCESS; + + /* + * Shut down the audio output device. + * and release resources + */ + if (s->audio_fd != NULL) + { + if (close(s->audio_fd) < 0) + { + perror("Close aix audio fd failed"); + result = SA_ERROR_SYSTEM; + } + } + + s->thread_id = 0; + + while (s->bl_head != NULL) { + sa_buf * next = s->bl_head->next; + free(s->bl_head); + s->bl_head = next; + } + + pthread_mutex_unlock(&s->mutex); + + if (pthread_mutex_destroy(&s->mutex) != 0) { + result = SA_ERROR_SYSTEM; + } + + free(s); + + return result; +} + +/* + * ----------------------------------------------------------------------------- + * Data read and write functions + * ----------------------------------------------------------------------------- + */ + +int +sa_stream_write(sa_stream_t *s, const void *data, size_t nbytes) +{ + + int result; + sa_buf *buf; + + if (s == NULL || s->audio_fd == NULL) + return SA_ERROR_NO_INIT; + + if (nbytes == 0) + return SA_SUCCESS; + + + /* + * Append the new data to the end of our buffer list. + */ + result = SA_SUCCESS; + buf = new_buffer(nbytes); + + if (buf == NULL) + return SA_ERROR_OOM; + + memcpy(buf->data,data, nbytes); + + pthread_mutex_lock(&s->mutex); + if (!s->bl_head) + s->bl_head = buf; + else + s->bl_tail->next = buf; + + s->bl_tail = buf; + + pthread_mutex_unlock(&s->mutex); + + /* + * Once we have our first block of audio data, enable the audio callback + * function. This doesn't need to be protected by the mutex, because + * s->playing is not used in the audio callback thread, and it's probably + * better not to be inside the lock when we enable the audio callback. + */ + if (!s->playing) { + s->playing = 1; + if (pthread_create(&s->thread_id, NULL, audio_callback, s) != 0) { + result = SA_ERROR_SYSTEM; + } + } + + return result; +} + +static void* +audio_callback(void* data) +{ + sa_stream_t* s = (sa_stream_t*)data; + sa_buf *buf; + int fd,nbytes_written,bytes,nbytes; + + fd = s->audio_fd; + + while (1) + { + if (s->thread_id == 0) + break; + + pthread_mutex_lock(&s->mutex); + while (s->bl_head) + { + buf = s->bl_head; + s->bl_head = s->bl_head->next; + + nbytes_written = 0; + nbytes = buf->size; + + while (nbytes_written < nbytes) + { + LOOP_WHILE_EINTR(bytes,(write(fd, (void *)((buf->data)+nbytes_written), nbytes-nbytes_written))); + + nbytes_written += bytes; + if (nbytes_written != nbytes) + printf("AixAudio\tWrite completed short - %d vs %d. Write more data\n",nbytes_written,nbytes); + } + + free(buf); + s->bytes_played += nbytes; + } + pthread_mutex_unlock(&s->mutex); + } + + return NULL; +} + +/* + * ----------------------------------------------------------------------------- + * General query and support functions + * ----------------------------------------------------------------------------- + */ + +int +sa_stream_get_write_size(sa_stream_t *s, size_t *size) +{ + sa_buf * b; + size_t used = 0; + + if (s == NULL ) + return SA_ERROR_NO_INIT; + + /* there is no interface to get the avaiable writing buffer size + * in aix audio, we return max size here to force sa_stream_write() to + * be called when there is data to be played + */ + *size = BUF_SIZE; + + return SA_SUCCESS; +} + +/* --------------------------------------------------------------------------- + * General query and support functions + * ----------------------------------------------------------------------------- + */ + +int +sa_stream_get_position(sa_stream_t *s, sa_position_t position, int64_t *pos) +{ + if (s == NULL) { + return SA_ERROR_NO_INIT; + } + if (position != SA_POSITION_WRITE_SOFTWARE) { + return SA_ERROR_NOT_SUPPORTED; + } + + pthread_mutex_lock(&s->mutex); + *pos = s->bytes_played; + pthread_mutex_unlock(&s->mutex); + return SA_SUCCESS; +} + +static sa_buf * +new_buffer(int size) +{ + sa_buf * b = malloc(sizeof(sa_buf) + size); + if (b != NULL) { + b->size = size; + b->next = NULL; + } + return b; +} + +/* + * ----------------------------------------------------------------------------- + * Unsupported functions + * ----------------------------------------------------------------------------- + */ +#define UNSUPPORTED(func) func { return SA_ERROR_NOT_SUPPORTED; } + +UNSUPPORTED(int sa_stream_pause(sa_stream_t *s)) +UNSUPPORTED(int sa_stream_resume(sa_stream_t *s)) +UNSUPPORTED(int sa_stream_create_opaque(sa_stream_t **s, const char *client_name, sa_mode_t mode, const char *codec)) +UNSUPPORTED(int sa_stream_set_write_lower_watermark(sa_stream_t *s, size_t size)) +UNSUPPORTED(int sa_stream_set_read_lower_watermark(sa_stream_t *s, size_t size)) +UNSUPPORTED(int sa_stream_set_write_upper_watermark(sa_stream_t *s, size_t size)) +UNSUPPORTED(int sa_stream_set_read_upper_watermark(sa_stream_t *s, size_t size)) +UNSUPPORTED(int sa_stream_set_channel_map(sa_stream_t *s, const sa_channel_t map[], unsigned int n)) +UNSUPPORTED(int sa_stream_set_xrun_mode(sa_stream_t *s, sa_xrun_mode_t mode)) +UNSUPPORTED(int sa_stream_set_non_interleaved(sa_stream_t *s, int enable)) +UNSUPPORTED(int sa_stream_set_dynamic_rate(sa_stream_t *s, int enable)) +UNSUPPORTED(int sa_stream_set_driver(sa_stream_t *s, const char *driver)) +UNSUPPORTED(int sa_stream_start_thread(sa_stream_t *s, sa_event_callback_t callback)) +UNSUPPORTED(int sa_stream_stop_thread(sa_stream_t *s)) +UNSUPPORTED(int sa_stream_change_device(sa_stream_t *s, const char *device_name)) +UNSUPPORTED(int sa_stream_change_read_volume(sa_stream_t *s, const int32_t vol[], unsigned int n)) +UNSUPPORTED(int sa_stream_change_write_volume(sa_stream_t *s, const int32_t vol[], unsigned int n)) +UNSUPPORTED(int sa_stream_change_rate(sa_stream_t *s, unsigned int rate)) +UNSUPPORTED(int sa_stream_change_meta_data(sa_stream_t *s, const char *name, const void *data, size_t size)) +UNSUPPORTED(int sa_stream_change_user_data(sa_stream_t *s, const void *value)) +UNSUPPORTED(int sa_stream_set_adjust_rate(sa_stream_t *s, sa_adjust_t direction)) +UNSUPPORTED(int sa_stream_set_adjust_nchannels(sa_stream_t *s, sa_adjust_t direction)) +UNSUPPORTED(int sa_stream_set_adjust_pcm_format(sa_stream_t *s, sa_adjust_t direction)) +UNSUPPORTED(int sa_stream_set_adjust_watermarks(sa_stream_t *s, sa_adjust_t direction)) +UNSUPPORTED(int sa_stream_get_mode(sa_stream_t *s, sa_mode_t *access_mode)) +UNSUPPORTED(int sa_stream_get_codec(sa_stream_t *s, char *codec, size_t *size)) +UNSUPPORTED(int sa_stream_get_pcm_format(sa_stream_t *s, sa_pcm_format_t *format)) +UNSUPPORTED(int sa_stream_get_rate(sa_stream_t *s, unsigned int *rate)) +UNSUPPORTED(int sa_stream_get_nchannels(sa_stream_t *s, int *nchannels)) +UNSUPPORTED(int sa_stream_get_user_data(sa_stream_t *s, void **value)) +UNSUPPORTED(int sa_stream_get_write_lower_watermark(sa_stream_t *s, size_t *size)) +UNSUPPORTED(int sa_stream_get_read_lower_watermark(sa_stream_t *s, size_t *size)) +UNSUPPORTED(int sa_stream_get_write_upper_watermark(sa_stream_t *s, size_t *size)) +UNSUPPORTED(int sa_stream_get_read_upper_watermark(sa_stream_t *s, size_t *size)) +UNSUPPORTED(int sa_stream_get_channel_map(sa_stream_t *s, sa_channel_t map[], unsigned int *n)) +UNSUPPORTED(int sa_stream_get_xrun_mode(sa_stream_t *s, sa_xrun_mode_t *mode)) +UNSUPPORTED(int sa_stream_get_non_interleaved(sa_stream_t *s, int *enabled)) +UNSUPPORTED(int sa_stream_get_dynamic_rate(sa_stream_t *s, int *enabled)) +UNSUPPORTED(int sa_stream_get_driver(sa_stream_t *s, char *driver_name, size_t *size)) +UNSUPPORTED(int sa_stream_get_device(sa_stream_t *s, char *device_name, size_t *size)) +UNSUPPORTED(int sa_stream_get_read_volume(sa_stream_t *s, int32_t vol[], unsigned int *n)) +UNSUPPORTED(int sa_stream_get_write_volume(sa_stream_t *s, int32_t vol[], unsigned int *n)) +UNSUPPORTED(int sa_stream_get_meta_data(sa_stream_t *s, const char *name, void*data, size_t *size)) +UNSUPPORTED(int sa_stream_get_adjust_rate(sa_stream_t *s, sa_adjust_t *direction)) +UNSUPPORTED(int sa_stream_get_adjust_nchannels(sa_stream_t *s, sa_adjust_t *direction)) +UNSUPPORTED(int sa_stream_get_adjust_pcm_format(sa_stream_t *s, sa_adjust_t *direction)) +UNSUPPORTED(int sa_stream_get_adjust_watermarks(sa_stream_t *s, sa_adjust_t *direction)) +UNSUPPORTED(int sa_stream_get_state(sa_stream_t *s, sa_state_t *state)) +UNSUPPORTED(int sa_stream_get_event_error(sa_stream_t *s, sa_error_t *error)) +UNSUPPORTED(int sa_stream_get_event_notify(sa_stream_t *s, sa_notify_t *notify)) +UNSUPPORTED(int sa_stream_read(sa_stream_t *s, void *data, size_t nbytes)) +UNSUPPORTED(int sa_stream_read_ni(sa_stream_t *s, unsigned int channel, void *data, size_t nbytes)) +UNSUPPORTED(int sa_stream_write_ni(sa_stream_t *s, unsigned int channel, const void *data, size_t nbytes)) +UNSUPPORTED(int sa_stream_pwrite(sa_stream_t *s, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence)) +UNSUPPORTED(int sa_stream_pwrite_ni(sa_stream_t *s, unsigned int channel, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence)) +UNSUPPORTED(int sa_stream_get_read_size(sa_stream_t *s, size_t *size)) +UNSUPPORTED(int sa_stream_drain(sa_stream_t *s)) + +const char *sa_strerror(int code) { return NULL; } + diff --git a/media/libtheora/lib/Makefile.in b/media/libtheora/lib/Makefile.in --- a/media/libtheora/lib/Makefile.in +++ b/media/libtheora/lib/Makefile.in @@ -83,8 +83,12 @@ CSRCS += \ mmxstate.c \ mmxidct.c \ $(NULL) endif include $(topsrcdir)/config/rules.mk LOCAL_INCLUDES = -I$(srcdir) + +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qlanglvl=extc99 +endif diff --git a/media/libvorbis/lib/Makefile.in b/media/libvorbis/lib/Makefile.in --- a/media/libvorbis/lib/Makefile.in +++ b/media/libvorbis/lib/Makefile.in @@ -64,8 +64,12 @@ CSRCS = \ vorbis_registry.c \ vorbis_codebook.c \ vorbis_sharedbook.c \ vorbis_lookup.c \ vorbis_bitrate.c \ $(NULL) include $(topsrcdir)/config/rules.mk + +ifeq ($(OS_ARCH),AIX) +CFLAGS += -qalloca -qlanglvl=extc99 +endif diff --git a/modules/plugin/base/public/nptypes.h b/modules/plugin/base/public/nptypes.h --- a/modules/plugin/base/public/nptypes.h +++ b/modules/plugin/base/public/nptypes.h @@ -31,16 +31,19 @@ * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ +#ifndef nptypes_h_ +#define nptypes_h_ + /* * Header file for ensuring that C99 types ([u]int32_t and bool) and * true/false macros are available. */ #if defined(WIN32) || defined(OS2) /* * Win32 and OS/2 don't know C99, so define [u]int_16/32 here. The bool @@ -106,8 +109,11 @@ * works. */ #define bool int #define true 1 #define false 0 #endif #endif #endif + +#endif /* nptypes_h_ */ + diff --git a/nsprpub/pr/include/md/_aix.h b/nsprpub/pr/include/md/_aix.h --- a/nsprpub/pr/include/md/_aix.h +++ b/nsprpub/pr/include/md/_aix.h @@ -72,18 +72,20 @@ #define USE_DLFCN #define _PR_HAVE_SOCKADDR_LEN #define _PR_POLL_AVAILABLE #define _PR_USE_POLL #define _PR_STAT_HAS_ONLY_ST_ATIME #ifdef _PR_INET6 #define _PR_HAVE_INET_NTOP #define _PR_HAVE_GETHOSTBYNAME2 +#ifdef _AIX51 /* AIX 4.3.3 does not have AI_NUMERICHOST. */ #define _PR_HAVE_GETADDRINFO #endif +#endif #define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY #define _PR_ACCEPT_INHERIT_NONBLOCK /* Timer operations */ #if defined(AIX_TIMERS) extern PRIntervalTime _MD_AixGetInterval(void); #define _MD_GET_INTERVAL _MD_AixGetInterval diff --git a/nsprpub/pr/src/linking/prlink.c b/nsprpub/pr/src/linking/prlink.c --- a/nsprpub/pr/src/linking/prlink.c +++ b/nsprpub/pr/src/linking/prlink.c @@ -69,16 +69,19 @@ #ifndef RTLD_GLOBAL #define RTLD_GLOBAL 0 #endif #ifndef RTLD_LOCAL #define RTLD_LOCAL 0 #endif #ifdef AIX #include +#ifndef L_IGNOREUNLOAD /* AIX 4.3.3 does not have L_IGNOREUNLOAD. */ +#define L_IGNOREUNLOAD 0x10000000 +#endif #endif #ifdef OSF1 #include #include #endif #elif defined(USE_HPSHL) #include #elif defined(USE_MACH_DYLD) diff --git a/widget/src/gtk2/Makefile.in b/widget/src/gtk2/Makefile.in --- a/widget/src/gtk2/Makefile.in +++ b/widget/src/gtk2/Makefile.in @@ -181,9 +181,13 @@ INCLUDES += \ -I$(srcdir)/../xpwidgets \ -I$(topsrcdir)/other-licenses/atk-1.0 \ $(NULL) test_container: mozdrawingarea.o mozcontainer.o test_container.c $(CC) $(MOZ_GTK2_CFLAGS) -o test_container test_container.c \ mozdrawingarea.o mozcontainer.o \ $(MOZ_GTK2_LIBS) + +ifeq ($(OS_ARCH),AIX) +CXXFLAGS += -qlanglvl=varargmacros +endif diff --git a/widget/src/gtk2/nsClipboard.cpp b/widget/src/gtk2/nsClipboard.cpp --- a/widget/src/gtk2/nsClipboard.cpp +++ b/widget/src/gtk2/nsClipboard.cpp @@ -54,16 +54,20 @@ // For manipulation of the X event queue #include #include #include #include #include #include +#if ! defined (_AIX51) && defined (_AIX43) +#include +#endif + #ifdef POLL_WITH_XCONNECTIONNUMBER #include #endif // Callback when someone asks us for the selection void invisible_selection_get_cb (GtkWidget *aWidget, GtkSelectionData *aSelectionData, diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -59,17 +59,23 @@ #include "nsIDragSessionGTK.h" #include "nsGtkKeyUtils.h" #include "nsGtkCursors.h" #include #ifdef MOZ_X11 #include + +#ifdef AIX /* #Bug 458057 */ +#include +#else #include +#endif + #include "gtk2xtbin.h" #endif /* MOZ_X11 */ #include #include "nsWidgetAtoms.h" #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION #define SN_API_NOT_YET_FROZEN @@ -128,17 +134,17 @@ extern "C" { #include D_DEBUG_DOMAIN( ns_Window, "nsWindow", "nsWindow" ); } #include "gfxDirectFBSurface.h" #define GDK_WINDOW_XWINDOW(_win) _win #else -#define D_DEBUG_AT(x,y...) do {} while (0) +#define D_DEBUG_AT(x,...) do {} while (0) #endif // Don't put more than this many rects in the dirty region, just fluff // out to the bounding-box if there are more #define MAX_RECTS_IN_REGION 100 /* For PrepareNativeWidget */ static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID); @@ -3182,16 +3188,17 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWi || aEvent->keyval == GDK_Alt_L || aEvent->keyval == GDK_Alt_R || aEvent->keyval == GDK_Meta_L || aEvent->keyval == GDK_Meta_R) { return TRUE; } #ifdef MOZ_X11 +#if ! defined AIX // no XFree86 on AIX 5L // Look for specialized app-command keys switch (aEvent->keyval) { case XF86XK_Back: return DispatchCommandEvent(nsWidgetAtoms::Back); case XF86XK_Forward: return DispatchCommandEvent(nsWidgetAtoms::Forward); case XF86XK_Refresh: return DispatchCommandEvent(nsWidgetAtoms::Reload); @@ -3199,16 +3206,17 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWi return DispatchCommandEvent(nsWidgetAtoms::Stop); case XF86XK_Search: return DispatchCommandEvent(nsWidgetAtoms::Search); case XF86XK_Favorites: return DispatchCommandEvent(nsWidgetAtoms::Bookmarks); case XF86XK_HomePage: return DispatchCommandEvent(nsWidgetAtoms::Home); } +#endif /* ! AIX */ #endif /* MOZ_X11 */ nsKeyEvent event(PR_TRUE, NS_KEY_PRESS, this); InitKeyEvent(event, aEvent); if (isKeyDownCancelled) { // If prevent default set for onkeydown, do the same for onkeypress event.flags |= NS_EVENT_FLAG_NO_DEFAULT; } diff --git a/xpcom/io/nsLocalFileUnix.h b/xpcom/io/nsLocalFileUnix.h --- a/xpcom/io/nsLocalFileUnix.h +++ b/xpcom/io/nsLocalFileUnix.h @@ -82,16 +82,21 @@ #if defined(__FreeBSD__) #define HAVE_SYS_STATFS_H #define STATFS statfs #include #include #endif #if defined(HAVE_STAT64) && defined(HAVE_LSTAT64) + #if defined (AIX) + #if defined STAT + #undef STAT + #endif + #endif #define STAT stat64 #define LSTAT lstat64 #define HAVE_STATS64 1 #else #define STAT stat #define LSTAT lstat #endif